<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for nusoap.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file nusoap.php</h1>
<p>Documentation is available at <a href="../nusoap/_nusoap_php.html">nusoap.php</a></p>
<div class="src-code">
<pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a>&nbsp;</li>
<li><a name="a3"></a><span class="src-comm">/*</span></li>
<li><a name="a4"></a><span class="src-comm">$Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a5"></a>&nbsp;</li>
<li><a name="a6"></a><span class="src-comm">NuSOAP - Web Services Toolkit for PHP</span></li>
<li><a name="a7"></a>&nbsp;</li>
<li><a name="a8"></a><span class="src-comm">Copyright (c) 2002 NuSphere Corporation</span></li>
<li><a name="a9"></a>&nbsp;</li>
<li><a name="a10"></a><span class="src-comm">This library is free software; you can redistribute it and/or</span></li>
<li><a name="a11"></a><span class="src-comm">modify it under the terms of the GNU Lesser General Public</span></li>
<li><a name="a12"></a><span class="src-comm">License as published by the Free Software Foundation; either</span></li>
<li><a name="a13"></a><span class="src-comm">version 2.1 of the License, or (at your option) any later version.</span></li>
<li><a name="a14"></a>&nbsp;</li>
<li><a name="a15"></a><span class="src-comm">This library is distributed in the hope that it will be useful,</span></li>
<li><a name="a16"></a><span class="src-comm">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></li>
<li><a name="a17"></a><span class="src-comm">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span></li>
<li><a name="a18"></a><span class="src-comm">Lesser General Public License for more details.</span></li>
<li><a name="a19"></a>&nbsp;</li>
<li><a name="a20"></a><span class="src-comm">You should have received a copy of the GNU Lesser General Public</span></li>
<li><a name="a21"></a><span class="src-comm">License along with this library; if not, write to the Free Software</span></li>
<li><a name="a22"></a><span class="src-comm">Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span></li>
<li><a name="a23"></a>&nbsp;</li>
<li><a name="a24"></a><span class="src-comm">The NuSOAP project home is:</span></li>
<li><a name="a25"></a><span class="src-comm">http://sourceforge.net/projects/nusoap/</span></li>
<li><a name="a26"></a>&nbsp;</li>
<li><a name="a27"></a><span class="src-comm">The primary support for NuSOAP is the Help forum on the project home page.</span></li>
<li><a name="a28"></a>&nbsp;</li>
<li><a name="a29"></a><span class="src-comm">If you have any questions or comments, please email:</span></li>
<li><a name="a30"></a>&nbsp;</li>
<li><a name="a31"></a><span class="src-comm">Dietrich Ayala</span></li>
<li><a name="a32"></a><span class="src-comm">dietrich@ganx4.com</span></li>
<li><a name="a33"></a><span class="src-comm">http://dietrich.ganx4.com/nusoap</span></li>
<li><a name="a34"></a>&nbsp;</li>
<li><a name="a35"></a><span class="src-comm">NuSphere Corporation</span></li>
<li><a name="a36"></a><span class="src-comm">http://www.nusphere.com</span></li>
<li><a name="a37"></a>&nbsp;</li>
<li><a name="a38"></a><span class="src-comm">*/</span></li>
<li><a name="a39"></a>&nbsp;</li>
<li><a name="a40"></a><span class="src-comm">/*</span></li>
<li><a name="a41"></a><span class="src-comm"> *    Some of the standards implmented in whole or part by NuSOAP:</span></li>
<li><a name="a42"></a><span class="src-comm"> *</span></li>
<li><a name="a43"></a><span class="src-comm"> *    SOAP 1.1 (http://www.w3.org/TR/2000/NOTE-SOAP-20000508/)</span></li>
<li><a name="a44"></a><span class="src-comm"> *    WSDL 1.1 (http://www.w3.org/TR/2001/NOTE-wsdl-20010315)</span></li>
<li><a name="a45"></a><span class="src-comm"> *    SOAP Messages With Attachments (http://www.w3.org/TR/SOAP-attachments)</span></li>
<li><a name="a46"></a><span class="src-comm"> *    XML 1.0 (http://www.w3.org/TR/2006/REC-xml-20060816/)</span></li>
<li><a name="a47"></a><span class="src-comm"> *    Namespaces in XML 1.0 (http://www.w3.org/TR/2006/REC-xml-names-20060816/)</span></li>
<li><a name="a48"></a><span class="src-comm"> *    XML Schema 1.0 (http://www.w3.org/TR/xmlschema-0/)</span></li>
<li><a name="a49"></a><span class="src-comm"> *    RFC 2045 Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</span></li>
<li><a name="a50"></a><span class="src-comm"> *    RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1</span></li>
<li><a name="a51"></a><span class="src-comm"> *    RFC 2617 HTTP Authentication: Basic and Digest Access Authentication</span></li>
<li><a name="a52"></a><span class="src-comm"> */</span></li>
<li><a name="a53"></a>&nbsp;</li>
<li><a name="a55"></a><span class="src-comm">/* load classes</span></li>
<li><a name="a56"></a><span class="src-comm">// necessary classes</span></li>
<li><a name="a57"></a><span class="src-comm">require_once('class.soapclient.php');</span></li>
<li><a name="a58"></a><span class="src-comm">require_once('class.soap_val.php');</span></li>
<li><a name="a59"></a><span class="src-comm">require_once('class.soap_parser.php');</span></li>
<li><a name="a60"></a><span class="src-comm">require_once('class.soap_fault.php');</span></li>
<li><a name="a61"></a>&nbsp;</li>
<li><a name="a62"></a><span class="src-comm">// transport classes</span></li>
<li><a name="a63"></a><span class="src-comm">require_once('class.soap_transport_http.php');</span></li>
<li><a name="a64"></a>&nbsp;</li>
<li><a name="a65"></a><span class="src-comm">// optional add-on classes</span></li>
<li><a name="a66"></a><span class="src-comm">require_once('class.xmlschema.php');</span></li>
<li><a name="a67"></a><span class="src-comm">require_once('class.wsdl.php');</span></li>
<li><a name="a68"></a>&nbsp;</li>
<li><a name="a69"></a><span class="src-comm">// server class</span></li>
<li><a name="a70"></a><span class="src-comm">require_once('class.soap_server.php');*/</span></li>
<li><a name="a71"></a>&nbsp;</li>
<li><a name="a72"></a><span class="src-comm">// class variable emulation</span></li>
<li><a name="a73"></a><span class="src-comm">// cf. http://www.webkreator.com/php/techniques/php-static-class-variables.html</span></li>
<li><a name="a73"></a>&nbsp;</li>
<li><a name="a74"></a><span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'_transient'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'static'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nusoap_base'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'globalDebugLevel'</span><span class="src-sym">] </span>= <span class="src-num">9</span><span class="src-sym">;</span></li>
<li><a name="a75"></a>&nbsp;</li>
<li><a name="a76"></a><span class="src-doc">/**</span></li>
<li><a name="a77"></a><span class="src-doc">*</span></li>
<li><a name="a78"></a><span class="src-doc">* nusoap_base</span></li>
<li><a name="a79"></a><span class="src-doc">*</span></li>
<li><a name="a80"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a81"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a82"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a83"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a84"></a><span class="src-doc">*/</span></li>
<li><a name="a85"></a><span class="src-key">class </span><a href="../nusoap/nusoap_base.html">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a86"></a>    <span class="src-doc">/**</span></li>
<li><a name="a87"></a><span class="src-doc">     * Identification for HTTP headers.</span></li>
<li><a name="a88"></a><span class="src-doc">     *</span></li>
<li><a name="a89"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a90"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a91"></a><span class="src-doc">     */</span></li>
<li><a name="a92"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$title">$title</a> = <span class="src-str">'NuSOAP'</span><span class="src-sym">;</span></li>
<li><a name="a93"></a>    <span class="src-doc">/**</span></li>
<li><a name="a94"></a><span class="src-doc">     * Version for HTTP headers.</span></li>
<li><a name="a95"></a><span class="src-doc">     *</span></li>
<li><a name="a96"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a97"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a98"></a><span class="src-doc">     */</span></li>
<li><a name="a99"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$version">$version</a> = <span class="src-str">'0.9.5'</span><span class="src-sym">;</span></li>
<li><a name="a100"></a>    <span class="src-doc">/**</span></li>
<li><a name="a101"></a><span class="src-doc">     * CVS revision for HTTP headers.</span></li>
<li><a name="a102"></a><span class="src-doc">     *</span></li>
<li><a name="a103"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a104"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a105"></a><span class="src-doc">     */</span></li>
<li><a name="a106"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$revision">$revision</a> = <span class="src-str">'$Revision: 1.2 $'</span><span class="src-sym">;</span></li>
<li><a name="a107"></a>    <span class="src-doc">/**</span></li>
<li><a name="a108"></a><span class="src-doc">     * Current error string (manipulated by getError/setError)</span></li>
<li><a name="a109"></a><span class="src-doc">     *</span></li>
<li><a name="a110"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a111"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a112"></a><span class="src-doc">     */</span></li>
<li><a name="a113"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$error_str">$error_str</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a114"></a>    <span class="src-doc">/**</span></li>
<li><a name="a115"></a><span class="src-doc">     * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)</span></li>
<li><a name="a116"></a><span class="src-doc">     *</span></li>
<li><a name="a117"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a118"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a119"></a><span class="src-doc">     */</span></li>
<li><a name="a120"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$debug_str">$debug_str</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a121"></a>    <span class="src-doc">/**</span></li>
<li><a name="a122"></a><span class="src-doc">     * toggles automatic encoding of special characters as entities</span></li>
<li><a name="a123"></a><span class="src-doc">     * (should always be true, I think)</span></li>
<li><a name="a124"></a><span class="src-doc">     *</span></li>
<li><a name="a125"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">boolean </span></li>
<li><a name="a126"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a127"></a><span class="src-doc">     */</span></li>
<li><a name="a128"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$charencoding">$charencoding</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a129"></a>    <span class="src-doc">/**</span></li>
<li><a name="a130"></a><span class="src-doc">     * the debug level for this instance</span></li>
<li><a name="a131"></a><span class="src-doc">     *</span></li>
<li><a name="a132"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc">   </span><span class="src-doc-type">integer </span></li>
<li><a name="a133"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a134"></a><span class="src-doc">     */</span></li>
<li><a name="a135"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$debugLevel">$debugLevel</a><span class="src-sym">;</span></li>
<li><a name="a136"></a>&nbsp;</li>
<li><a name="a137"></a>    <span class="src-doc">/**</span></li>
<li><a name="a138"></a><span class="src-doc">    * set schema version</span></li>
<li><a name="a139"></a><span class="src-doc">    *</span></li>
<li><a name="a140"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">string </span></li>
<li><a name="a141"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a142"></a><span class="src-doc">    */</span></li>
<li><a name="a143"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">$XMLSchemaVersion</a> = <span class="src-str">'http://www.w3.org/2001/XMLSchema'</span><span class="src-sym">;</span></li>
<li><a name="a144"></a>    </li>
<li><a name="a145"></a>    <span class="src-doc">/**</span></li>
<li><a name="a146"></a><span class="src-doc">    * charset encoding for outgoing messages</span></li>
<li><a name="a147"></a><span class="src-doc">    *</span></li>
<li><a name="a148"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">string </span></li>
<li><a name="a149"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a150"></a><span class="src-doc">    */</span></li>
<li><a name="a151"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">$soap_defencoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a152"></a>    <span class="src-comm">//var $soap_defencoding = 'UTF-8';</span></li>
<li><a name="a153"></a>&nbsp;</li>
<li><a name="a152"></a>    </li>
<li><a name="a153"></a>&nbsp;</li>
<li><a name="a154"></a>    <span class="src-doc">/**</span></li>
<li><a name="a155"></a><span class="src-doc">    * namespaces in an array of prefix =&gt; uri</span></li>
<li><a name="a156"></a><span class="src-doc">    *</span></li>
<li><a name="a157"></a><span class="src-doc">    * this is &quot;seeded&quot; by a set of constants, but it may be altered by code</span></li>
<li><a name="a158"></a><span class="src-doc">    *</span></li>
<li><a name="a159"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">array </span></li>
<li><a name="a160"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a161"></a><span class="src-doc">    */</span></li>
<li><a name="a162"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$namespaces">$namespaces</a> = <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a163"></a>        <span class="src-str">'SOAP-ENV' </span>=&gt; <span class="src-str">'http://schemas.xmlsoap.org/soap/envelope/'</span><span class="src-sym">,</span></li>
<li><a name="a164"></a>        <span class="src-str">'xsd' </span>=&gt; <span class="src-str">'http://www.w3.org/2001/XMLSchema'</span><span class="src-sym">,</span></li>
<li><a name="a165"></a>        <span class="src-str">'xsi' </span>=&gt; <span class="src-str">'http://www.w3.org/2001/XMLSchema-instance'</span><span class="src-sym">,</span></li>
<li><a name="a166"></a>        <span class="src-str">'SOAP-ENC' </span>=&gt; <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span></li>
<li><a name="a167"></a>        <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a168"></a>&nbsp;</li>
<li><a name="a169"></a>    <span class="src-doc">/**</span></li>
<li><a name="a170"></a><span class="src-doc">    * namespaces used in the current context, e.g. during serialization</span></li>
<li><a name="a171"></a><span class="src-doc">    *</span></li>
<li><a name="a172"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">array </span></li>
<li><a name="a173"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a174"></a><span class="src-doc">    */</span></li>
<li><a name="a175"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$usedNamespaces">$usedNamespaces</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a176"></a>&nbsp;</li>
<li><a name="a177"></a>    <span class="src-doc">/**</span></li>
<li><a name="a178"></a><span class="src-doc">    * XML Schema types in an array of uri =&gt; (array of xml type =&gt; php type)</span></li>
<li><a name="a179"></a><span class="src-doc">    * is this legacy yet?</span></li>
<li><a name="a180"></a><span class="src-doc">    * no, this is used by the nusoap_xmlschema class to verify type =&gt; namespace mappings.</span></li>
<li><a name="a181"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">array </span></li>
<li><a name="a182"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a183"></a><span class="src-doc">    */</span></li>
<li><a name="a184"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$typemap">$typemap</a> = <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a185"></a>    <span class="src-str">'http://www.w3.org/2001/XMLSchema' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a186"></a>        <span class="src-str">'string'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'boolean'</span>=&gt;<span class="src-str">'boolean'</span><span class="src-sym">,</span><span class="src-str">'float'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span><span class="src-str">'double'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span><span class="src-str">'decimal'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span></li>
<li><a name="a187"></a>        <span class="src-str">'duration'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'dateTime'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'time'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'date'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'gYearMonth'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span></li>
<li><a name="a188"></a>        <span class="src-str">'gYear'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'gMonthDay'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'gDay'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'gMonth'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'hexBinary'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'base64Binary'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span></li>
<li><a name="a189"></a>        <span class="src-comm">// abstract &quot;any&quot; types</span></li>
<li><a name="a189"></a>        </li>
<li><a name="a190"></a>        <span class="src-str">'anyType'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'anySimpleType'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span></li>
<li><a name="a191"></a>        <span class="src-comm">// derived datatypes</span></li>
<li><a name="a191"></a>        </li>
<li><a name="a192"></a>        <span class="src-str">'normalizedString'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'token'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'language'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'NMTOKEN'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'NMTOKENS'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'Name'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'NCName'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'ID'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span></li>
<li><a name="a193"></a>        <span class="src-str">'IDREF'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'IDREFS'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'ENTITY'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'ENTITIES'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'integer'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'nonPositiveInteger'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span></li>
<li><a name="a194"></a>        <span class="src-str">'negativeInteger'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'long'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'int'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'short'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'byte'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'nonNegativeInteger'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span></li>
<li><a name="a195"></a>        <span class="src-str">'unsignedLong'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'unsignedInt'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'unsignedShort'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'unsignedByte'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'positiveInteger'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a196"></a>    <span class="src-str">'http://www.w3.org/2000/10/XMLSchema' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a197"></a>        <span class="src-str">'i4'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'int'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'boolean'</span>=&gt;<span class="src-str">'boolean'</span><span class="src-sym">,</span><span class="src-str">'string'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'double'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span></li>
<li><a name="a198"></a>        <span class="src-str">'float'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span><span class="src-str">'dateTime'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span></li>
<li><a name="a199"></a>        <span class="src-str">'timeInstant'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'base64Binary'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'base64'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'ur-type'</span>=&gt;<span class="src-str">'array'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a200"></a>    <span class="src-str">'http://www.w3.org/1999/XMLSchema' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a201"></a>        <span class="src-str">'i4'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'int'</span>=&gt;<span class="src-str">'integer'</span><span class="src-sym">,</span><span class="src-str">'boolean'</span>=&gt;<span class="src-str">'boolean'</span><span class="src-sym">,</span><span class="src-str">'string'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'double'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span></li>
<li><a name="a202"></a>        <span class="src-str">'float'</span>=&gt;<span class="src-str">'double'</span><span class="src-sym">,</span><span class="src-str">'dateTime'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span></li>
<li><a name="a203"></a>        <span class="src-str">'timeInstant'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'base64Binary'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'base64'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'ur-type'</span>=&gt;<span class="src-str">'array'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a204"></a>    <span class="src-str">'http://soapinterop.org/xsd' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'SOAPStruct'</span>=&gt;<span class="src-str">'struct'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a205"></a>    <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'base64'</span>=&gt;<span class="src-str">'string'</span><span class="src-sym">,</span><span class="src-str">'array'</span>=&gt;<span class="src-str">'array'</span><span class="src-sym">,</span><span class="src-str">'Array'</span>=&gt;<span class="src-str">'array'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a206"></a>    <span class="src-str">'http://xml.apache.org/xml-soap' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'Map'</span><span class="src-sym">)</span></li>
<li><a name="a207"></a>    <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a208"></a>&nbsp;</li>
<li><a name="a209"></a>    <span class="src-doc">/**</span></li>
<li><a name="a210"></a><span class="src-doc">    * XML entities to convert</span></li>
<li><a name="a211"></a><span class="src-doc">    *</span></li>
<li><a name="a212"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">array </span></li>
<li><a name="a213"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a214"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a215"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc">    expandEntities</span></li>
<li><a name="a216"></a><span class="src-doc">    */</span></li>
<li><a name="a217"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_base.html#var$xmlEntities">$xmlEntities</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'quot' </span>=&gt; <span class="src-str">'&quot;'</span><span class="src-sym">,</span><span class="src-str">'amp' </span>=&gt; <span class="src-str">'&amp;'</span><span class="src-sym">,</span></li>
<li><a name="a218"></a>        <span class="src-str">'lt' </span>=&gt; <span class="src-str">'&lt;'</span><span class="src-sym">,</span><span class="src-str">'gt' </span>=&gt; <span class="src-str">'&gt;'</span><span class="src-sym">,</span><span class="src-str">'apos' </span>=&gt; <span class="src-str">&quot;'&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a219"></a>&nbsp;</li>
<li><a name="a220"></a>    <span class="src-doc">/**</span></li>
<li><a name="a221"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a222"></a><span class="src-doc">    *</span></li>
<li><a name="a223"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a224"></a><span class="src-doc">    */</span></li>
<li><a name="a225"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a226"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debugLevel">debugLevel</a> = <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'_transient'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'static'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nusoap_base'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'globalDebugLevel'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a227"></a>    <span class="src-sym">}</span></li>
<li><a name="a228"></a>&nbsp;</li>
<li><a name="a229"></a>    <span class="src-doc">/**</span></li>
<li><a name="a230"></a><span class="src-doc">    * gets the global debug level, which applies to future instances</span></li>
<li><a name="a231"></a><span class="src-doc">    *</span></li>
<li><a name="a232"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc">   Debug level 0-9, where 0 turns off</span></li>
<li><a name="a233"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a234"></a><span class="src-doc">    */</span></li>
<li><a name="a235"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetGlobalDebugLevel">getGlobalDebugLevel</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a236"></a>        <span class="src-key">return </span><span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'_transient'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'static'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nusoap_base'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'globalDebugLevel'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a237"></a>    <span class="src-sym">}</span></li>
<li><a name="a238"></a>&nbsp;</li>
<li><a name="a239"></a>    <span class="src-doc">/**</span></li>
<li><a name="a240"></a><span class="src-doc">    * sets the global debug level, which applies to future instances</span></li>
<li><a name="a241"></a><span class="src-doc">    *</span></li>
<li><a name="a242"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc-var">$level </span><span class="src-doc">   Debug level 0-9, where 0 turns off</span></li>
<li><a name="a243"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a244"></a><span class="src-doc">    */</span></li>
<li><a name="a245"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodsetGlobalDebugLevel">setGlobalDebugLevel</a><span class="src-sym">(</span><span class="src-var">$level</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a246"></a>        <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'_transient'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'static'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nusoap_base'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'globalDebugLevel'</span><span class="src-sym">] </span>= <span class="src-var">$level</span><span class="src-sym">;</span></li>
<li><a name="a247"></a>    <span class="src-sym">}</span></li>
<li><a name="a248"></a>&nbsp;</li>
<li><a name="a249"></a>    <span class="src-doc">/**</span></li>
<li><a name="a250"></a><span class="src-doc">    * gets the debug level for this instance</span></li>
<li><a name="a251"></a><span class="src-doc">    *</span></li>
<li><a name="a252"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">int </span><span class="src-doc">   Debug level 0-9, where 0 turns off</span></li>
<li><a name="a253"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a254"></a><span class="src-doc">    */</span></li>
<li><a name="a255"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetDebugLevel">getDebugLevel</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a256"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debugLevel">debugLevel</a><span class="src-sym">;</span></li>
<li><a name="a257"></a>    <span class="src-sym">}</span></li>
<li><a name="a258"></a>&nbsp;</li>
<li><a name="a259"></a>    <span class="src-doc">/**</span></li>
<li><a name="a260"></a><span class="src-doc">    * sets the debug level for this instance</span></li>
<li><a name="a261"></a><span class="src-doc">    *</span></li>
<li><a name="a262"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc-var">$level </span><span class="src-doc">   Debug level 0-9, where 0 turns off</span></li>
<li><a name="a263"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a264"></a><span class="src-doc">    */</span></li>
<li><a name="a265"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodsetDebugLevel">setDebugLevel</a><span class="src-sym">(</span><span class="src-var">$level</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a266"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debugLevel">debugLevel</a> = <span class="src-var">$level</span><span class="src-sym">;</span></li>
<li><a name="a267"></a>    <span class="src-sym">}</span></li>
<li><a name="a268"></a>&nbsp;</li>
<li><a name="a269"></a>    <span class="src-doc">/**</span></li>
<li><a name="a270"></a><span class="src-doc">    * adds debug data to the instance debug string with formatting</span></li>
<li><a name="a271"></a><span class="src-doc">    *</span></li>
<li><a name="a272"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$string </span><span class="src-doc">debug data</span></li>
<li><a name="a273"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a274"></a><span class="src-doc">    */</span></li>
<li><a name="a275"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a276"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debugLevel">debugLevel</a> &gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a277"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetmicrotime">getmicrotime</a><span class="src-sym">(</span><span class="src-sym">)</span>.<span class="src-str">' '</span>.<a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)</span>.<span class="src-str">&quot;</span><span class="src-str">: <span class="src-var">$string</span>\n</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a278"></a>        <span class="src-sym">}</span></li>
<li><a name="a279"></a>    <span class="src-sym">}</span></li>
<li><a name="a280"></a>&nbsp;</li>
<li><a name="a281"></a>    <span class="src-doc">/**</span></li>
<li><a name="a282"></a><span class="src-doc">    * adds debug data to the instance debug string without formatting</span></li>
<li><a name="a283"></a><span class="src-doc">    *</span></li>
<li><a name="a284"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$string </span><span class="src-doc">debug data</span></li>
<li><a name="a285"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a286"></a><span class="src-doc">    */</span></li>
<li><a name="a287"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a288"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debugLevel">debugLevel</a> &gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a289"></a>            <span class="src-comm">// it would be nice to use a memory stream here to use</span></li>
<li><a name="a290"></a>            <span class="src-comm">// memory more efficiently</span></li>
<li><a name="a291"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a> .= <span class="src-var">$string</span><span class="src-sym">;</span></li>
<li><a name="a292"></a>        <span class="src-sym">}</span></li>
<li><a name="a293"></a>    <span class="src-sym">}</span></li>
<li><a name="a294"></a>&nbsp;</li>
<li><a name="a295"></a>    <span class="src-doc">/**</span></li>
<li><a name="a296"></a><span class="src-doc">    * clears the current debug data for this instance</span></li>
<li><a name="a297"></a><span class="src-doc">    *</span></li>
<li><a name="a298"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a299"></a><span class="src-doc">    */</span></li>
<li><a name="a300"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodclearDebug">clearDebug</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a301"></a>        <span class="src-comm">// it would be nice to use a memory stream here to use</span></li>
<li><a name="a302"></a>        <span class="src-comm">// memory more efficiently</span></li>
<li><a name="a303"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a304"></a>    <span class="src-sym">}</span></li>
<li><a name="a305"></a>&nbsp;</li>
<li><a name="a306"></a>    <span class="src-doc">/**</span></li>
<li><a name="a307"></a><span class="src-doc">    * gets the current debug data for this instance</span></li>
<li><a name="a308"></a><span class="src-doc">    *</span></li>
<li><a name="a309"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">debug </span><span class="src-doc">data</span></li>
<li><a name="a310"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a311"></a><span class="src-doc">    */</span></li>
<li><a name="a312"></a>    <span class="src-key">function </span><span class="src-sym">&amp;</span><a href="../nusoap/nusoap_base.html#methodgetDebug">getDebug</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a313"></a>        <span class="src-comm">// it would be nice to use a memory stream here to use</span></li>
<li><a name="a314"></a>        <span class="src-comm">// memory more efficiently</span></li>
<li><a name="a315"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a><span class="src-sym">;</span></li>
<li><a name="a316"></a>    <span class="src-sym">}</span></li>
<li><a name="a317"></a>&nbsp;</li>
<li><a name="a318"></a>    <span class="src-doc">/**</span></li>
<li><a name="a319"></a><span class="src-doc">    * gets the current debug data for this instance as an XML comment</span></li>
<li><a name="a320"></a><span class="src-doc">    * this may change the contents of the debug data</span></li>
<li><a name="a321"></a><span class="src-doc">    *</span></li>
<li><a name="a322"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">debug </span><span class="src-doc">data as an XML comment</span></li>
<li><a name="a323"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a324"></a><span class="src-doc">    */</span></li>
<li><a name="a325"></a>    <span class="src-key">function </span><span class="src-sym">&amp;</span><a href="../nusoap/nusoap_base.html#methodgetDebugAsXMLComment">getDebugAsXMLComment</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a326"></a>        <span class="src-comm">// it would be nice to use a memory stream here to use</span></li>
<li><a name="a327"></a>        <span class="src-comm">// memory more efficiently</span></li>
<li><a name="a328"></a>        <span class="src-key">while </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a><span class="src-sym">, </span><span class="src-str">'--'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a329"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'--'</span><span class="src-sym">, </span><span class="src-str">'- -'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a330"></a>        <span class="src-sym">}</span></li>
<li><a name="a331"></a>        <span class="src-var">$ret </span>= <span class="src-str">&quot;&lt;!--\n&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$debug_str">debug_str</a> . <span class="src-str">&quot;\n--&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a332"></a>        <span class="src-key">return </span><span class="src-var">$ret</span><span class="src-sym">;</span></li>
<li><a name="a333"></a>    <span class="src-sym">}</span></li>
<li><a name="a334"></a>&nbsp;</li>
<li><a name="a335"></a>    <span class="src-doc">/**</span></li>
<li><a name="a336"></a><span class="src-doc">    * expands entities, e.g. changes '&lt;' to '&amp;lt;'.</span></li>
<li><a name="a337"></a><span class="src-doc">    *</span></li>
<li><a name="a338"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$val </span><span class="src-doc">   The string in which to expand entities.</span></li>
<li><a name="a339"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a340"></a><span class="src-doc">    */</span></li>
<li><a name="a341"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a342"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$charencoding">charencoding</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a343"></a>            <span class="src-var">$val </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&amp;'</span><span class="src-sym">, </span><span class="src-str">'&amp;amp;'</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a344"></a>            <span class="src-var">$val </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;'&quot;</span><span class="src-sym">, </span><span class="src-str">'&amp;apos;'</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a345"></a>            <span class="src-var">$val </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">'&amp;quot;'</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a346"></a>            <span class="src-var">$val </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;'</span><span class="src-sym">, </span><span class="src-str">'&amp;lt;'</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a347"></a>            <span class="src-var">$val </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&gt;'</span><span class="src-sym">, </span><span class="src-str">'&amp;gt;'</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a348"></a>        <span class="src-sym">}</span></li>
<li><a name="a349"></a>        <span class="src-key">return </span><span class="src-var">$val</span><span class="src-sym">;</span></li>
<li><a name="a350"></a>    <span class="src-sym">}</span></li>
<li><a name="a351"></a>&nbsp;</li>
<li><a name="a352"></a>    <span class="src-doc">/**</span></li>
<li><a name="a353"></a><span class="src-doc">    * returns error string if present</span></li>
<li><a name="a354"></a><span class="src-doc">    *</span></li>
<li><a name="a355"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">mixed </span><span class="src-doc">error string or false</span></li>
<li><a name="a356"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a357"></a><span class="src-doc">    */</span></li>
<li><a name="a358"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a359"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a360"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a><span class="src-sym">;</span></li>
<li><a name="a361"></a>        <span class="src-sym">}</span></li>
<li><a name="a362"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a363"></a>    <span class="src-sym">}</span></li>
<li><a name="a364"></a>&nbsp;</li>
<li><a name="a365"></a>    <span class="src-doc">/**</span></li>
<li><a name="a366"></a><span class="src-doc">    * sets error string</span></li>
<li><a name="a367"></a><span class="src-doc">    *</span></li>
<li><a name="a368"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">boolean </span><span class="src-doc">$string error string</span></li>
<li><a name="a369"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a370"></a><span class="src-doc">    */</span></li>
<li><a name="a371"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a372"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a> = <span class="src-var">$str</span><span class="src-sym">;</span></li>
<li><a name="a373"></a>    <span class="src-sym">}</span></li>
<li><a name="a374"></a>&nbsp;</li>
<li><a name="a375"></a>    <span class="src-doc">/**</span></li>
<li><a name="a376"></a><span class="src-doc">    * detect if array is a simple array or a struct (associative array)</span></li>
<li><a name="a377"></a><span class="src-doc">    *</span></li>
<li><a name="a378"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   </span><span class="src-doc-var">$val </span><span class="src-doc">   The PHP array</span></li>
<li><a name="a379"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   (arraySimple|arrayStruct)</span></li>
<li><a name="a380"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a381"></a><span class="src-doc">    */</span></li>
<li><a name="a382"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a383"></a>        <span class="src-var">$keyList </span>= <a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a384"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$keyList </span><span class="src-key">as </span><span class="src-var">$keyListValue</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a385"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$keyListValue</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a386"></a>                <span class="src-key">return </span><span class="src-str">'arrayStruct'</span><span class="src-sym">;</span></li>
<li><a name="a387"></a>            <span class="src-sym">}</span></li>
<li><a name="a388"></a>        <span class="src-sym">}</span></li>
<li><a name="a389"></a>        <span class="src-key">return </span><span class="src-str">'arraySimple'</span><span class="src-sym">;</span></li>
<li><a name="a390"></a>    <span class="src-sym">}</span></li>
<li><a name="a391"></a>&nbsp;</li>
<li><a name="a392"></a>    <span class="src-doc">/**</span></li>
<li><a name="a393"></a><span class="src-doc">    * serializes PHP values in accordance w/ section 5. Type information is</span></li>
<li><a name="a394"></a><span class="src-doc">    * not serialized if $use == 'literal'.</span></li>
<li><a name="a395"></a><span class="src-doc">    *</span></li>
<li><a name="a396"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   </span><span class="src-doc-var">$val </span><span class="src-doc">   The value to serialize</span></li>
<li><a name="a397"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$name </span><span class="src-doc">   The name (local part) of the XML element</span></li>
<li><a name="a398"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$type </span><span class="src-doc">   The XML schema type (local part) for the element</span></li>
<li><a name="a399"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$name_ns </span><span class="src-doc">   The namespace for the name of the XML element</span></li>
<li><a name="a400"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$type_ns </span><span class="src-doc">   The namespace for the type of the element</span></li>
<li><a name="a401"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">   </span><span class="src-doc-var">$attributes </span><span class="src-doc">   The attributes to serialize as name=&gt;value pairs</span></li>
<li><a name="a402"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$use </span><span class="src-doc">   The WSDL &quot;use&quot; (encoded|literal)</span></li>
<li><a name="a403"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">   </span><span class="src-doc-var">$soapval </span><span class="src-doc">   Whether this is called from soapval.</span></li>
<li><a name="a404"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   The serialized element, possibly with child elements</span></li>
<li><a name="a405"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a406"></a><span class="src-doc">    */</span></li>
<li><a name="a407"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">,</span><span class="src-var">$name</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$type</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$name_ns</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$type_ns</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$attributes</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">,</span><span class="src-var">$soapval</span>=<span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a408"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serialize_val: name=<span class="src-var">$name</span>, type=<span class="src-var">$type</span>, name_ns=<span class="src-var">$name_ns</span>, type_ns=<span class="src-var">$type_ns</span>, use=<span class="src-var">$use</span>, soapval=<span class="src-var">$soapval</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a409"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'value=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a410"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'attributes=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$attributes</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a411"></a>        </li>
<li><a name="a412"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>== <span class="src-str">'soapval' </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$soapval</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a413"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize soapval&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a414"></a>            <span class="src-var">$xml </span>= <span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">serialize</span><span class="src-sym">(</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a415"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a416"></a>            <span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a417"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val of soapval returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a418"></a>            <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a419"></a>        <span class="src-sym">}</span></li>
<li><a name="a420"></a>        <span class="src-comm">// force valid name if necessary</span></li>
<li><a name="a421"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a422"></a>            <span class="src-var">$name </span>= <span class="src-str">'__numeric_' </span>. <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a423"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a424"></a>            <span class="src-var">$name </span>= <span class="src-str">'noname'</span><span class="src-sym">;</span></li>
<li><a name="a425"></a>        <span class="src-sym">}</span></li>
<li><a name="a426"></a>        <span class="src-comm">// if name has ns, add ns prefix to name</span></li>
<li><a name="a427"></a>        <span class="src-var">$xmlns </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a428"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name_ns</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a429"></a>            <span class="src-var">$prefix </span>= <span class="src-str">'nu'</span>.<a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">,</span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a430"></a>            <span class="src-var">$name </span>= <span class="src-var">$prefix</span>.<span class="src-str">':'</span>.<span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a431"></a>            <span class="src-var">$xmlns </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$prefix</span>=\&quot;<span class="src-var">$name_ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a432"></a>        <span class="src-sym">}</span></li>
<li><a name="a433"></a>        <span class="src-comm">// if type is prefixed, create type prefix</span></li>
<li><a name="a434"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$type_ns </span>!= <span class="src-str">'' </span>&amp;&amp; <span class="src-var">$type_ns </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsd'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a435"></a>            <span class="src-comm">// need to fix this. shouldn't default to xsd if no ns specified</span></li>
<li><a name="a436"></a>            <span class="src-comm">// w/o checking against typemap</span></li>
<li><a name="a437"></a>            <span class="src-var">$type_prefix </span>= <span class="src-str">'xsd'</span><span class="src-sym">;</span></li>
<li><a name="a438"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$type_ns</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a439"></a>            <span class="src-var">$type_prefix </span>= <span class="src-str">'ns'</span>.<a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">,</span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a440"></a>            <span class="src-var">$xmlns </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$type_prefix</span>=\&quot;<span class="src-var">$type_ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a441"></a>        <span class="src-sym">}</span></li>
<li><a name="a442"></a>        <span class="src-comm">// serialize attributes if present</span></li>
<li><a name="a443"></a>        <span class="src-var">$atts </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a444"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$attributes</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a445"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attributes </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a446"></a>                <span class="src-var">$atts </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$k</span>=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span>.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a447"></a>            <span class="src-sym">}</span></li>
<li><a name="a448"></a>        <span class="src-sym">}</span></li>
<li><a name="a449"></a>        <span class="src-comm">// serialize null value</span></li>
<li><a name="a450"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a451"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize null&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a452"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a453"></a>                <span class="src-comm">// TODO: depends on minOccurs</span></li>
<li><a name="a454"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a455"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a456"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a457"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a458"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$type_prefix</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a459"></a>                    <span class="src-var">$type_str </span>= <span class="src-str">&quot;</span><span class="src-str"> xsi:type=\&quot;<span class="src-var">$type_prefix</span>:<span class="src-var">$type</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a460"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a461"></a>                    <span class="src-var">$type_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a462"></a>                <span class="src-sym">}</span></li>
<li><a name="a463"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$type_str$atts</span> xsi:nil=\&quot;true\&quot;/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a464"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a465"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a466"></a>            <span class="src-sym">}</span></li>
<li><a name="a467"></a>        <span class="src-sym">}</span></li>
<li><a name="a468"></a>        <span class="src-comm">// serialize if an xsd built-in primitive type</span></li>
<li><a name="a469"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$type </span>!= <span class="src-str">'' </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a470"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize xsd built-in primitive type&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a471"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_bool">is_bool</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a472"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'boolean'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a473"></a>                    <span class="src-var">$val </span>= <span class="src-var">$val </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">;</span></li>
<li><a name="a474"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a475"></a>                    <span class="src-var">$val </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a476"></a>                <span class="src-sym">}</span></li>
<li><a name="a477"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a478"></a>                <span class="src-var">$val </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a479"></a>            <span class="src-sym">}</span></li>
<li><a name="a480"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a481"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a482"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a483"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a484"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a485"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns</span> xsi:type=\&quot;xsd:<span class="src-var">$type</span>\&quot;<span class="src-var">$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a486"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a487"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a488"></a>            <span class="src-sym">}</span></li>
<li><a name="a489"></a>        <span class="src-sym">}</span></li>
<li><a name="a490"></a>        <span class="src-comm">// detect type and serialize</span></li>
<li><a name="a491"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a492"></a>        <span class="src-key">switch</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a493"></a>            <span class="src-key">case </span><span class="src-sym">(</span><a href="http://www.php.net/is_bool">is_bool</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <span class="src-var">$type </span>== <span class="src-str">'boolean'</span><span class="src-sym">)</span>:</li>
<li><a name="a494"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize boolean&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a495"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'boolean'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a496"></a>                    <span class="src-var">$val </span>= <span class="src-var">$val </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">;</span></li>
<li><a name="a497"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a498"></a>                    <span class="src-var">$val </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a499"></a>                <span class="src-sym">}</span></li>
<li><a name="a500"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a501"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a502"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a503"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns</span> xsi:type=\&quot;xsd:boolean\&quot;<span class="src-var">$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a504"></a>                <span class="src-sym">}</span></li>
<li><a name="a505"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a506"></a>            <span class="src-key">case </span><span class="src-sym">(</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <a href="http://www.php.net/is_long">is_long</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <span class="src-var">$type </span>== <span class="src-str">'int'</span><span class="src-sym">)</span>:</li>
<li><a name="a507"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize int&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a508"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a509"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a510"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a511"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns</span> xsi:type=\&quot;xsd:int\&quot;<span class="src-var">$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a512"></a>                <span class="src-sym">}</span></li>
<li><a name="a513"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a514"></a>            <span class="src-key">case </span><span class="src-sym">(</span><a href="http://www.php.net/is_float">is_float</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span>|| <a href="http://www.php.net/is_double">is_double</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <span class="src-var">$type </span>== <span class="src-str">'float'</span><span class="src-sym">)</span>:</li>
<li><a name="a515"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize float&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a516"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a517"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a518"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a519"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns</span> xsi:type=\&quot;xsd:float\&quot;<span class="src-var">$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a520"></a>                <span class="src-sym">}</span></li>
<li><a name="a521"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a522"></a>            <span class="src-key">case </span><span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <span class="src-var">$type </span>== <span class="src-str">'string'</span><span class="src-sym">)</span>:</li>
<li><a name="a523"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize string&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a524"></a>                <span class="src-var">$val </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a525"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a526"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a527"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a528"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns</span> xsi:type=\&quot;xsd:string\&quot;<span class="src-var">$atts</span>&gt;<span class="src-var">$val</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a529"></a>                <span class="src-sym">}</span></li>
<li><a name="a530"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a531"></a>            <span class="src-key">case </span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span>:</li>
<li><a name="a532"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize object&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a533"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>== <span class="src-str">'soapval'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a534"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize soapval object&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a535"></a>                    <span class="src-var">$pXml </span>= <span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">serialize</span><span class="src-sym">(</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a536"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a537"></a>                    <span class="src-var">$val</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a538"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a539"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a540"></a>                        <span class="src-var">$name </span>= <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a541"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">In serialize_val, used class name <span class="src-var">$name</span> as element name</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a542"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a543"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">In serialize_val, do not override name <span class="src-var">$name</span> for element name for class </span><span class="src-str">&quot; </span>. <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a544"></a>                    <span class="src-sym">}</span></li>
<li><a name="a545"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/get_object_vars">get_object_vars</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a546"></a>                        <span class="src-var">$pXml </span>= isset<span class="src-sym">(</span><span class="src-var">$pXml</span><span class="src-sym">) </span>? <span class="src-var">$pXml</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">) </span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a547"></a>                    <span class="src-sym">}</span></li>
<li><a name="a548"></a>                <span class="src-sym">}</span></li>
<li><a name="a549"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$type_prefix</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a550"></a>                    <span class="src-var">$type_str </span>= <span class="src-str">&quot;</span><span class="src-str"> xsi:type=\&quot;<span class="src-var">$type_prefix</span>:<span class="src-var">$type</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a551"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a552"></a>                    <span class="src-var">$type_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a553"></a>                <span class="src-sym">}</span></li>
<li><a name="a554"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a555"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;<span class="src-var">$pXml</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a556"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a557"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$type_str$atts</span>&gt;<span class="src-var">$pXml</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a558"></a>                <span class="src-sym">}</span></li>
<li><a name="a559"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a560"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a561"></a>            <span class="src-key">case </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>|| <span class="src-var">$type</span><span class="src-sym">)</span>:</li>
<li><a name="a562"></a>                <span class="src-comm">// detect if struct or array</span></li>
<li><a name="a563"></a>                <span class="src-var">$valueType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a564"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$valueType</span>==<span class="src-str">'arraySimple' </span>|| <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^ArrayOf/'</span><span class="src-sym">,</span><span class="src-var">$type</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a565"></a>                       <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize array&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a566"></a>                    <span class="src-var">$i </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a567"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a568"></a>                        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$val </span><span class="src-key">as </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a569"></a>                            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>==  <span class="src-str">'soapval'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a570"></a>                                <span class="src-var">$tt_ns </span>= <span class="src-var">$v</span><span class="src-sym">-&gt;</span><span class="src-id">type_ns</span><span class="src-sym">;</span></li>
<li><a name="a571"></a>                                <span class="src-var">$tt </span>= <span class="src-var">$v</span><span class="src-sym">-&gt;</span><span class="src-id">type</span><span class="src-sym">;</span></li>
<li><a name="a572"></a>                            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a573"></a>                                <span class="src-var">$tt </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a574"></a>                            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a575"></a>                                <span class="src-var">$tt </span>= <a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a576"></a>                            <span class="src-sym">}</span></li>
<li><a name="a577"></a>                            <span class="src-var">$array_types</span><span class="src-sym">[</span><span class="src-var">$tt</span><span class="src-sym">] </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a578"></a>                            <span class="src-comm">// TODO: for literal, the name should be $name</span></li>
<li><a name="a579"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">'item'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a580"></a>                            ++<span class="src-var">$i</span><span class="src-sym">;</span></li>
<li><a name="a581"></a>                        <span class="src-sym">}</span></li>
<li><a name="a582"></a>                        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$array_types</span><span class="src-sym">) </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a583"></a>                            <span class="src-var">$array_typename </span>= <span class="src-str">'xsd:anyType'</span><span class="src-sym">;</span></li>
<li><a name="a584"></a>                        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$tt</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$tt</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a585"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tt </span>== <span class="src-str">'integer'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a586"></a>                                <span class="src-var">$tt </span>= <span class="src-str">'int'</span><span class="src-sym">;</span></li>
<li><a name="a587"></a>                            <span class="src-sym">}</span></li>
<li><a name="a588"></a>                            <span class="src-var">$array_typename </span>= <span class="src-str">'xsd:'</span>.<span class="src-var">$tt</span><span class="src-sym">;</span></li>
<li><a name="a589"></a>                        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$tt</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$tt </span>== <span class="src-str">'arraySimple'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a590"></a>                            <span class="src-var">$array_typename </span>= <span class="src-str">'SOAP-ENC:Array'</span><span class="src-sym">;</span></li>
<li><a name="a591"></a>                        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$tt</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$tt </span>== <span class="src-str">'arrayStruct'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a592"></a>                            <span class="src-var">$array_typename </span>= <span class="src-str">'unnamed_struct_use_soapval'</span><span class="src-sym">;</span></li>
<li><a name="a593"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a594"></a>                            <span class="src-comm">// if type is prefixed, create type prefix</span></li>
<li><a name="a595"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tt_ns </span>!= <span class="src-str">'' </span>&amp;&amp; <span class="src-var">$tt_ns </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsd'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a596"></a>                                 <span class="src-var">$array_typename </span>= <span class="src-str">'xsd:' </span>. <span class="src-var">$tt</span><span class="src-sym">;</span></li>
<li><a name="a597"></a>                            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$tt_ns</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a598"></a>                                <span class="src-var">$tt_prefix </span>= <span class="src-str">'ns' </span>. <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">, </span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a599"></a>                                <span class="src-var">$array_typename </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$tt_prefix</span>:<span class="src-var">$tt</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a600"></a>                                <span class="src-var">$xmlns </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$tt_prefix</span>=\&quot;<span class="src-var">$tt_ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a601"></a>                            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a602"></a>                                <span class="src-var">$array_typename </span>= <span class="src-var">$tt</span><span class="src-sym">;</span></li>
<li><a name="a603"></a>                            <span class="src-sym">}</span></li>
<li><a name="a604"></a>                        <span class="src-sym">}</span></li>
<li><a name="a605"></a>                        <span class="src-var">$array_type </span>= <span class="src-var">$i</span><span class="src-sym">;</span></li>
<li><a name="a606"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a607"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a608"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$type_prefix</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a609"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">&quot;</span><span class="src-str"> xsi:type=\&quot;<span class="src-var">$type_prefix</span>:<span class="src-var">$type</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a610"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a611"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">&quot; xsi:type=\&quot;SOAP-ENC:Array\&quot; SOAP-ENC:arrayType=\&quot;&quot;</span>.<span class="src-var">$array_typename</span>.<span class="src-str">&quot;</span><span class="src-str">[<span class="src-var">$array_type</span>]\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a612"></a>                        <span class="src-sym">}</span></li>
<li><a name="a613"></a>                    <span class="src-comm">// empty array</span></li>
<li><a name="a614"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a615"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a616"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a617"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$type_prefix</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a618"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">&quot;</span><span class="src-str"> xsi:type=\&quot;<span class="src-var">$type_prefix</span>:<span class="src-var">$type</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a619"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a620"></a>                            <span class="src-var">$type_str </span>= <span class="src-str">&quot; xsi:type=\&quot;SOAP-ENC:Array\&quot; SOAP-ENC:arrayType=\&quot;xsd:anyType[0]\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a621"></a>                        <span class="src-sym">}</span></li>
<li><a name="a622"></a>                    <span class="src-sym">}</span></li>
<li><a name="a623"></a>                    <span class="src-comm">// TODO: for array in literal, there is no wrapper here</span></li>
<li><a name="a624"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$type_str$atts</span>&gt;</span><span class="src-str">&quot;</span>.<span class="src-var">$xml</span>.<span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a625"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a626"></a>                    <span class="src-comm">// got a struct</span></li>
<li><a name="a627"></a>                       <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize struct&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a628"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$type_prefix</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a629"></a>                        <span class="src-var">$type_str </span>= <span class="src-str">&quot;</span><span class="src-str"> xsi:type=\&quot;<span class="src-var">$type_prefix</span>:<span class="src-var">$type</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a630"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a631"></a>                        <span class="src-var">$type_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a632"></a>                    <span class="src-sym">}</span></li>
<li><a name="a633"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a634"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$atts</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a635"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a636"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$xmlns$type_str$atts</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a637"></a>                    <span class="src-sym">}</span></li>
<li><a name="a638"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$val </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a639"></a>                        <span class="src-comm">// Apache Map</span></li>
<li><a name="a640"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'Map' </span>&amp;&amp; <span class="src-var">$type_ns </span>== <span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a641"></a>                            <span class="src-var">$xml </span>.= <span class="src-str">'&lt;item&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a642"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">'key'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a643"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a644"></a>                            <span class="src-var">$xml </span>.= <span class="src-str">'&lt;/item&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a645"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a646"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a647"></a>                        <span class="src-sym">}</span></li>
<li><a name="a648"></a>                    <span class="src-sym">}</span></li>
<li><a name="a649"></a>                    <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a650"></a>                <span class="src-sym">}</span></li>
<li><a name="a651"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a652"></a>            <span class="src-key">default</span>:</li>
<li><a name="a653"></a>                   <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;serialize_val: serialize unknown&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a654"></a>                <span class="src-var">$xml </span>.= <span class="src-str">'not detected, got '</span>.<a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span>.<span class="src-str">' for '</span>.<span class="src-var">$val</span><span class="src-sym">;</span></li>
<li><a name="a655"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a656"></a>        <span class="src-sym">}</span></li>
<li><a name="a657"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize_val returning <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a658"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a659"></a>    <span class="src-sym">}</span></li>
<li><a name="a660"></a>&nbsp;</li>
<li><a name="a661"></a>    <span class="src-doc">/**</span></li>
<li><a name="a662"></a><span class="src-doc">    * serializes a message</span></li>
<li><a name="a663"></a><span class="src-doc">    *</span></li>
<li><a name="a664"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$body </span><span class="src-doc">the XML of the SOAP body</span></li>
<li><a name="a665"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$headers </span><span class="src-doc">optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array</span></li>
<li><a name="a666"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$namespaces </span><span class="src-doc">optional the namespaces used in generating the body and headers</span></li>
<li><a name="a667"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$style </span><span class="src-doc">optional (rpc|document)</span></li>
<li><a name="a668"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$use </span><span class="src-doc">optional (encoded|literal)</span></li>
<li><a name="a669"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$encodingStyle </span><span class="src-doc">optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)</span></li>
<li><a name="a670"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">the message</span></li>
<li><a name="a671"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a672"></a><span class="src-doc">    */</span></li>
<li><a name="a673"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodserializeEnvelope">serializeEnvelope</a><span class="src-sym">(</span><span class="src-var">$body</span><span class="src-sym">,</span><span class="src-var">$headers</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$namespaces</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$style</span>=<span class="src-str">'rpc'</span><span class="src-sym">,</span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">,</span><span class="src-var">$encodingStyle</span>=<span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a674"></a>    <span class="src-comm">// TODO: add an option to automatically run utf8_encode on $body and $headers</span></li>
<li><a name="a675"></a>    <span class="src-comm">// if $this-&gt;soap_defencoding is UTF-8.  Not doing this automatically allows</span></li>
<li><a name="a676"></a>    <span class="src-comm">// one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1</span></li>
<li><a name="a677"></a>&nbsp;</li>
<li><a name="a678"></a>    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In serializeEnvelope length=&quot; </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$body</span><span class="src-sym">) </span>. <span class="src-str">&quot; body (max 1000 characters)=&quot; </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$body</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">1000</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str"> style=<span class="src-var">$style</span> use=<span class="src-var">$use</span> encodingStyle=<span class="src-var">$encodingStyle</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a679"></a>    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;headers:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a680"></a>    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a681"></a>    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;namespaces:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a682"></a>    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$namespaces</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a683"></a>&nbsp;</li>
<li><a name="a684"></a>    <span class="src-comm">// serialize namespaces</span></li>
<li><a name="a685"></a>    <span class="src-var">$ns_string </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a686"></a>    <span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">,</span><span class="src-var">$namespaces</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a687"></a>        <span class="src-var">$ns_string </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$k</span>=\&quot;<span class="src-var">$v</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a688"></a>    <span class="src-sym">}</span></li>
<li><a name="a689"></a>    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$encodingStyle</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a690"></a>        <span class="src-var">$ns_string </span>= <span class="src-str">&quot;</span><span class="src-str"> SOAP-ENV:encodingStyle=\&quot;<span class="src-var">$encodingStyle</span>\&quot;<span class="src-var">$ns_string</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a691"></a>    <span class="src-sym">}</span></li>
<li><a name="a692"></a>&nbsp;</li>
<li><a name="a693"></a>    <span class="src-comm">// serialize headers</span></li>
<li><a name="a694"></a>    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a695"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a696"></a>            <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a697"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$headers </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a698"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>== <span class="src-str">'soapval'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a699"></a>                    <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a700"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a701"></a>                    <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a702"></a>                <span class="src-sym">}</span></li>
<li><a name="a703"></a>            <span class="src-sym">}</span></li>
<li><a name="a704"></a>            <span class="src-var">$headers </span>= <span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a705"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">In serializeEnvelope, serialized array of headers to <span class="src-var">$headers</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a706"></a>        <span class="src-sym">}</span></li>
<li><a name="a707"></a>        <span class="src-var">$headers </span>= <span class="src-str">&quot;&lt;SOAP-ENV:Header&gt;&quot;</span>.<span class="src-var">$headers</span>.<span class="src-str">&quot;&lt;/SOAP-ENV:Header&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a708"></a>    <span class="src-sym">}</span></li>
<li><a name="a709"></a>    <span class="src-comm">// serialize envelope</span></li>
<li><a name="a710"></a>    <span class="src-key">return</span></li>
<li><a name="a711"></a>    <span class="src-str">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a> .<span class="src-str">'&quot;?'</span>.<span class="src-str">&quot;&gt;&quot;</span>.</li>
<li><a name="a712"></a>    <span class="src-str">'&lt;SOAP-ENV:Envelope'</span>.<span class="src-var">$ns_string</span>.<span class="src-str">&quot;&gt;&quot;</span>.</li>
<li><a name="a713"></a>    <span class="src-var">$headers</span>.</li>
<li><a name="a714"></a>    <span class="src-str">&quot;&lt;SOAP-ENV:Body&gt;&quot;</span>.</li>
<li><a name="a715"></a>        <span class="src-var">$body</span>.</li>
<li><a name="a716"></a>    <span class="src-str">&quot;&lt;/SOAP-ENV:Body&gt;&quot;</span>.</li>
<li><a name="a717"></a>    <span class="src-str">&quot;&lt;/SOAP-ENV:Envelope&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a718"></a>    <span class="src-sym">}</span></li>
<li><a name="a719"></a>&nbsp;</li>
<li><a name="a720"></a>    <span class="src-doc">/**</span></li>
<li><a name="a721"></a><span class="src-doc">     * formats a string to be inserted into an HTML stream</span></li>
<li><a name="a722"></a><span class="src-doc">     *</span></li>
<li><a name="a723"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$str </span><span class="src-doc">The string to format</span></li>
<li><a name="a724"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The formatted string</span></li>
<li><a name="a725"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a726"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a727"></a><span class="src-doc">     */</span></li>
<li><a name="a728"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodformatDump">formatDump</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a729"></a>        <span class="src-var">$str </span>= <a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a730"></a>        <span class="src-key">return </span><a href="http://www.php.net/nl2br">nl2br</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a731"></a>    <span class="src-sym">}</span></li>
<li><a name="a732"></a>&nbsp;</li>
<li><a name="a733"></a>    <span class="src-doc">/**</span></li>
<li><a name="a734"></a><span class="src-doc">    * contracts (changes namespace to prefix) a qualified name</span></li>
<li><a name="a735"></a><span class="src-doc">    *</span></li>
<li><a name="a736"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$qname </span><span class="src-doc">qname</span></li>
<li><a name="a737"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">contracted qname</span></li>
<li><a name="a738"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a739"></a><span class="src-doc">    */</span></li>
<li><a name="a740"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodcontractQname">contractQname</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a741"></a>        <span class="src-comm">// get element namespace</span></li>
<li><a name="a742"></a>        <span class="src-comm">//$this-&gt;xdebug(&quot;Contract $qname&quot;);</span></li>
<li><a name="a743"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a744"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a745"></a>            <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a746"></a>            <span class="src-comm">// get ns</span></li>
<li><a name="a747"></a>            <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a748"></a>            <span class="src-var">$p </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a749"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$p</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a750"></a>                <span class="src-key">return </span><span class="src-var">$p </span>. <span class="src-str">':' </span>. <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a751"></a>            <span class="src-sym">}</span></li>
<li><a name="a752"></a>            <span class="src-key">return </span><span class="src-var">$qname</span><span class="src-sym">;</span></li>
<li><a name="a753"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a754"></a>            <span class="src-key">return </span><span class="src-var">$qname</span><span class="src-sym">;</span></li>
<li><a name="a755"></a>        <span class="src-sym">}</span></li>
<li><a name="a756"></a>    <span class="src-sym">}</span></li>
<li><a name="a757"></a>&nbsp;</li>
<li><a name="a758"></a>    <span class="src-doc">/**</span></li>
<li><a name="a759"></a><span class="src-doc">    * expands (changes prefix to namespace) a qualified name</span></li>
<li><a name="a760"></a><span class="src-doc">    *</span></li>
<li><a name="a761"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$qname </span><span class="src-doc">qname</span></li>
<li><a name="a762"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">expanded qname</span></li>
<li><a name="a763"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a764"></a><span class="src-doc">    */</span></li>
<li><a name="a765"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a766"></a>        <span class="src-comm">// get element prefix</span></li>
<li><a name="a767"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^http:\/\//'</span><span class="src-sym">,</span><span class="src-var">$qname</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a768"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a769"></a>            <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a770"></a>            <span class="src-comm">// get ns prefix</span></li>
<li><a name="a771"></a>            <span class="src-var">$prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$qname</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a772"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a773"></a>                <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span>.<span class="src-str">':'</span>.<span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a774"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a775"></a>                <span class="src-key">return </span><span class="src-var">$qname</span><span class="src-sym">;</span></li>
<li><a name="a776"></a>            <span class="src-sym">}</span></li>
<li><a name="a777"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a778"></a>            <span class="src-key">return </span><span class="src-var">$qname</span><span class="src-sym">;</span></li>
<li><a name="a779"></a>        <span class="src-sym">}</span></li>
<li><a name="a780"></a>    <span class="src-sym">}</span></li>
<li><a name="a781"></a>&nbsp;</li>
<li><a name="a782"></a>    <span class="src-doc">/**</span></li>
<li><a name="a783"></a><span class="src-doc">    * returns the local part of a prefixed string</span></li>
<li><a name="a784"></a><span class="src-doc">    * returns the original string, if not prefixed</span></li>
<li><a name="a785"></a><span class="src-doc">    *</span></li>
<li><a name="a786"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$str </span><span class="src-doc">The prefixed string</span></li>
<li><a name="a787"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The local part</span></li>
<li><a name="a788"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a789"></a><span class="src-doc">    */</span></li>
<li><a name="a790"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a791"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$sstr </span>= <a href="http://www.php.net/strrchr">strrchr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a792"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a793"></a>            <span class="src-key">return </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">( </span><span class="src-var">$sstr</span><span class="src-sym">, </span><span class="src-num">1 </span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a794"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a795"></a>            <span class="src-key">return </span><span class="src-var">$str</span><span class="src-sym">;</span></li>
<li><a name="a796"></a>        <span class="src-sym">}</span></li>
<li><a name="a797"></a>    <span class="src-sym">}</span></li>
<li><a name="a798"></a>&nbsp;</li>
<li><a name="a799"></a>    <span class="src-doc">/**</span></li>
<li><a name="a800"></a><span class="src-doc">    * returns the prefix part of a prefixed string</span></li>
<li><a name="a801"></a><span class="src-doc">    * returns false, if not prefixed</span></li>
<li><a name="a802"></a><span class="src-doc">    *</span></li>
<li><a name="a803"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$str </span><span class="src-doc">The prefixed string</span></li>
<li><a name="a804"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">The prefix or false if there is no prefix</span></li>
<li><a name="a805"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a806"></a><span class="src-doc">    */</span></li>
<li><a name="a807"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a808"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a809"></a>            <span class="src-comm">// get prefix</span></li>
<li><a name="a810"></a>            <span class="src-key">return </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a811"></a>        <span class="src-sym">}</span></li>
<li><a name="a812"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a813"></a>    <span class="src-sym">}</span></li>
<li><a name="a814"></a>&nbsp;</li>
<li><a name="a815"></a>    <span class="src-doc">/**</span></li>
<li><a name="a816"></a><span class="src-doc">    * pass it a prefix, it returns a namespace</span></li>
<li><a name="a817"></a><span class="src-doc">    *</span></li>
<li><a name="a818"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$prefix </span><span class="src-doc">The prefix</span></li>
<li><a name="a819"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">The namespace, false if no namespace has the specified prefix</span></li>
<li><a name="a820"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a821"></a><span class="src-doc">    */</span></li>
<li><a name="a822"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a823"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a824"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a825"></a>        <span class="src-sym">}</span></li>
<li><a name="a826"></a>        <span class="src-comm">//$this-&gt;setError(&quot;No namespace registered for prefix '$prefix'&quot;);</span></li>
<li><a name="a827"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a828"></a>    <span class="src-sym">}</span></li>
<li><a name="a829"></a>&nbsp;</li>
<li><a name="a830"></a>    <span class="src-doc">/**</span></li>
<li><a name="a831"></a><span class="src-doc">    * returns the prefix for a given namespace (or prefix)</span></li>
<li><a name="a832"></a><span class="src-doc">    * or false if no prefixes registered for the given namespace</span></li>
<li><a name="a833"></a><span class="src-doc">    *</span></li>
<li><a name="a834"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$ns </span><span class="src-doc">The namespace</span></li>
<li><a name="a835"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">The prefix, false if the namespace has no prefixes</span></li>
<li><a name="a836"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a837"></a><span class="src-doc">    */</span></li>
<li><a name="a838"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a839"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a> <span class="src-key">as </span><span class="src-var">$p </span>=&gt; <span class="src-var">$n</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a840"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ns </span>== <span class="src-var">$n </span>|| <span class="src-var">$ns </span>== <span class="src-var">$p</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a841"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$usedNamespaces">usedNamespaces</a><span class="src-sym">[</span><span class="src-var">$p</span><span class="src-sym">] </span>= <span class="src-var">$n</span><span class="src-sym">;</span></li>
<li><a name="a842"></a>                <span class="src-key">return </span><span class="src-var">$p</span><span class="src-sym">;</span></li>
<li><a name="a843"></a>            <span class="src-sym">}</span></li>
<li><a name="a844"></a>        <span class="src-sym">}</span></li>
<li><a name="a845"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a846"></a>    <span class="src-sym">}</span></li>
<li><a name="a847"></a>&nbsp;</li>
<li><a name="a848"></a>    <span class="src-doc">/**</span></li>
<li><a name="a849"></a><span class="src-doc">    * returns the time in ODBC canonical form with microseconds</span></li>
<li><a name="a850"></a><span class="src-doc">    *</span></li>
<li><a name="a851"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The time in ODBC canonical form with microseconds</span></li>
<li><a name="a852"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a853"></a><span class="src-doc">    */</span></li>
<li><a name="a854"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodgetmicrotime">getmicrotime</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a855"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gettimeofday'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a856"></a>            <span class="src-var">$tod </span>= <a href="http://www.php.net/gettimeofday">gettimeofday</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a857"></a>            <span class="src-var">$sec </span>= <span class="src-var">$tod</span><span class="src-sym">[</span><span class="src-str">'sec'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a858"></a>            <span class="src-var">$usec </span>= <span class="src-var">$tod</span><span class="src-sym">[</span><span class="src-str">'usec'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a859"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a860"></a>            <span class="src-var">$sec </span>= <a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a861"></a>            <span class="src-var">$usec </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a862"></a>        <span class="src-sym">}</span></li>
<li><a name="a863"></a>        <span class="src-key">return </span><a href="http://www.php.net/strftime">strftime</a><span class="src-sym">(</span><span class="src-str">'%Y-%m-%d %H:%M:%S'</span><span class="src-sym">, </span><span class="src-var">$sec</span><span class="src-sym">) </span>. <span class="src-str">'.' </span>. <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'%06d'</span><span class="src-sym">, </span><span class="src-var">$usec</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a864"></a>    <span class="src-sym">}</span></li>
<li><a name="a865"></a>&nbsp;</li>
<li><a name="a866"></a>    <span class="src-doc">/**</span></li>
<li><a name="a867"></a><span class="src-doc">     * Returns a string with the output of var_dump</span></li>
<li><a name="a868"></a><span class="src-doc">     *</span></li>
<li><a name="a869"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$data </span><span class="src-doc">The variable to var_dump</span></li>
<li><a name="a870"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The output of var_dump</span></li>
<li><a name="a871"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a872"></a><span class="src-doc">     */</span></li>
<li><a name="a873"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a874"></a>        <a href="http://www.php.net/ob_start">ob_start</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a875"></a>        <a href="http://www.php.net/var_dump">var_dump</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a876"></a>        <span class="src-var">$ret_val </span>= <a href="http://www.php.net/ob_get_contents">ob_get_contents</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a877"></a>        <a href="http://www.php.net/ob_end_clean">ob_end_clean</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a878"></a>        <span class="src-key">return </span><span class="src-var">$ret_val</span><span class="src-sym">;</span></li>
<li><a name="a879"></a>    <span class="src-sym">}</span></li>
<li><a name="a880"></a>&nbsp;</li>
<li><a name="a881"></a>    <span class="src-doc">/**</span></li>
<li><a name="a882"></a><span class="src-doc">    * represents the object as a string</span></li>
<li><a name="a883"></a><span class="src-doc">    *</span></li>
<li><a name="a884"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span></li>
<li><a name="a885"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a886"></a><span class="src-doc">    */</span></li>
<li><a name="a887"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_base.html#method__toString">__toString</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a888"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a889"></a>    <span class="src-sym">}</span></li>
<li><a name="a890"></a><span class="src-sym">}</span></li>
<li><a name="a891"></a>&nbsp;</li>
<li><a name="a893"></a><span class="src-comm">// XML Schema Datatype Helper Functions</span></li>
<li><a name="a894"></a><span class="src-comm">//xsd:dateTime helpers</span></li>
<li><a name="a895"></a>&nbsp;</li>
<li><a name="a894"></a>&nbsp;</li>
<li><a name="a895"></a>&nbsp;</li>
<li><a name="a896"></a><span class="src-doc">/**</span></li>
<li><a name="a897"></a><span class="src-doc">* convert unix timestamp to ISO 8601 compliant date string</span></li>
<li><a name="a898"></a><span class="src-doc">*</span></li>
<li><a name="a899"></a><span class="src-doc">* </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">int </span><span class="src-doc-var">$timestamp </span><span class="src-doc">Unix time stamp</span></li>
<li><a name="a900"></a><span class="src-doc">* </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$utc </span><span class="src-doc">Whether the time stamp is UTC or local</span></li>
<li><a name="a901"></a><span class="src-doc">* </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">ISO 8601 date string or false</span></li>
<li><a name="a902"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a903"></a><span class="src-doc">*/</span></li>
<li><a name="a904"></a><span class="src-key">function </span><a href="../nusoap/_nusoap_php.html#functiontimestamp_to_iso8601">timestamp_to_iso8601</a><span class="src-sym">(</span><span class="src-var">$timestamp</span><span class="src-sym">,</span><span class="src-var">$utc</span>=<span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a905"></a>    <span class="src-var">$datestr </span>= <a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">'Y-m-d\TH:i:sO'</span><span class="src-sym">,</span><span class="src-var">$timestamp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a906"></a>    <span class="src-var">$pos </span>= <a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">, </span><span class="src-str">&quot;+&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a907"></a>    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>=== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a908"></a>        <span class="src-var">$pos </span>= <a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">, </span><span class="src-str">&quot;-&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a909"></a>    <span class="src-sym">}</span></li>
<li><a name="a910"></a>    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>!== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a911"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">) </span>== <span class="src-var">$pos </span>+ <span class="src-num">5</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a912"></a>            <span class="src-var">$datestr </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$pos </span>+ <span class="src-num">3</span><span class="src-sym">) </span>. <span class="src-str">':' </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">, </span>-<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a913"></a>        <span class="src-sym">}</span></li>
<li><a name="a914"></a>    <span class="src-sym">}</span></li>
<li><a name="a915"></a>    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$utc</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a916"></a>        <span class="src-var">$pattern </span>= <span class="src-str">'/'</span>.</li>
<li><a name="a917"></a>        <span class="src-str">'([0-9]{4})-'</span>.    <span class="src-comm">// centuries &amp; years CCYY-</span></li>
<li><a name="a918"></a>        <span class="src-str">'([0-9]{2})-'</span>.    <span class="src-comm">// months MM-</span></li>
<li><a name="a919"></a>        <span class="src-str">'([0-9]{2})'</span>.    <span class="src-comm">// days DD</span></li>
<li><a name="a920"></a>        <span class="src-str">'T'</span>.            <span class="src-comm">// separator T</span></li>
<li><a name="a921"></a>        <span class="src-str">'([0-9]{2}):'</span>.    <span class="src-comm">// hours hh:</span></li>
<li><a name="a922"></a>        <span class="src-str">'([0-9]{2}):'</span>.    <span class="src-comm">// minutes mm:</span></li>
<li><a name="a923"></a>        <span class="src-str">'([0-9]{2})(\.[0-9]*)?'</span>. <span class="src-comm">// seconds ss.ss...</span></li>
<li><a name="a924"></a>        <span class="src-str">'(Z|[+\-][0-9]{2}:?[0-9]{2})?'</span>. <span class="src-comm">// Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's</span></li>
<li><a name="a925"></a>        <span class="src-str">'/'</span><span class="src-sym">;</span></li>
<li><a name="a926"></a>&nbsp;</li>
<li><a name="a927"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$pattern</span><span class="src-sym">,</span><span class="src-var">$datestr</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a928"></a>            <span class="src-key">return </span><a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'%04d-%02d-%02dT%02d:%02d:%02dZ'</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a929"></a>        <span class="src-sym">}</span></li>
<li><a name="a930"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a931"></a>    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a932"></a>        <span class="src-key">return </span><span class="src-var">$datestr</span><span class="src-sym">;</span></li>
<li><a name="a933"></a>    <span class="src-sym">}</span></li>
<li><a name="a934"></a><span class="src-sym">}</span></li>
<li><a name="a935"></a>&nbsp;</li>
<li><a name="a936"></a><span class="src-doc">/**</span></li>
<li><a name="a937"></a><span class="src-doc">* convert ISO 8601 compliant date string to unix timestamp</span></li>
<li><a name="a938"></a><span class="src-doc">*</span></li>
<li><a name="a939"></a><span class="src-doc">* </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$datestr </span><span class="src-doc">ISO 8601 compliant date string</span></li>
<li><a name="a940"></a><span class="src-doc">* </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">Unix timestamp (int) or false</span></li>
<li><a name="a941"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a942"></a><span class="src-doc">*/</span></li>
<li><a name="a943"></a><span class="src-key">function </span><a href="../nusoap/_nusoap_php.html#functioniso8601_to_timestamp">iso8601_to_timestamp</a><span class="src-sym">(</span><span class="src-var">$datestr</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a944"></a>    <span class="src-var">$pattern </span>= <span class="src-str">'/'</span>.</li>
<li><a name="a945"></a>    <span class="src-str">'([0-9]{4})-'</span>.    <span class="src-comm">// centuries &amp; years CCYY-</span></li>
<li><a name="a946"></a>    <span class="src-str">'([0-9]{2})-'</span>.    <span class="src-comm">// months MM-</span></li>
<li><a name="a947"></a>    <span class="src-str">'([0-9]{2})'</span>.    <span class="src-comm">// days DD</span></li>
<li><a name="a948"></a>    <span class="src-str">'T'</span>.            <span class="src-comm">// separator T</span></li>
<li><a name="a949"></a>    <span class="src-str">'([0-9]{2}):'</span>.    <span class="src-comm">// hours hh:</span></li>
<li><a name="a950"></a>    <span class="src-str">'([0-9]{2}):'</span>.    <span class="src-comm">// minutes mm:</span></li>
<li><a name="a951"></a>    <span class="src-str">'([0-9]{2})(\.[0-9]+)?'</span>. <span class="src-comm">// seconds ss.ss...</span></li>
<li><a name="a952"></a>    <span class="src-str">'(Z|[+\-][0-9]{2}:?[0-9]{2})?'</span>. <span class="src-comm">// Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's</span></li>
<li><a name="a953"></a>    <span class="src-str">'/'</span><span class="src-sym">;</span></li>
<li><a name="a954"></a>    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$pattern</span><span class="src-sym">,</span><span class="src-var">$datestr</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a955"></a>        <span class="src-comm">// not utc</span></li>
<li><a name="a956"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">] </span>!= <span class="src-str">'Z'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a957"></a>            <span class="src-var">$op </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a958"></a>            <span class="src-var">$h </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a959"></a>            <span class="src-var">$m </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">,</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">)</span>-<span class="src-num">2</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a960"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$op </span>== <span class="src-str">'-'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a961"></a>                <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>+ <span class="src-var">$h</span><span class="src-sym">;</span></li>
<li><a name="a962"></a>                <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>+ <span class="src-var">$m</span><span class="src-sym">;</span></li>
<li><a name="a963"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$op </span>== <span class="src-str">'+'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a964"></a>                <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>- <span class="src-var">$h</span><span class="src-sym">;</span></li>
<li><a name="a965"></a>                <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>- <span class="src-var">$m</span><span class="src-sym">;</span></li>
<li><a name="a966"></a>            <span class="src-sym">}</span></li>
<li><a name="a967"></a>        <span class="src-sym">}</span></li>
<li><a name="a968"></a>        <span class="src-key">return </span><a href="http://www.php.net/gmmktime">gmmktime</a><span class="src-sym">(</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a969"></a><span class="src-comm">//        return strtotime(&quot;$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z&quot;);</span></li>
<li><a name="a970"></a>    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a971"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a972"></a>    <span class="src-sym">}</span></li>
<li><a name="a973"></a><span class="src-sym">}</span></li>
<li><a name="a974"></a>&nbsp;</li>
<li><a name="a975"></a><span class="src-doc">/**</span></li>
<li><a name="a976"></a><span class="src-doc">* sleeps some number of microseconds</span></li>
<li><a name="a977"></a><span class="src-doc">*</span></li>
<li><a name="a978"></a><span class="src-doc">* </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$usec </span><span class="src-doc">the number of microseconds to sleep</span></li>
<li><a name="a979"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a980"></a><span class="src-doc">* </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a981"></a><span class="src-doc">*/</span></li>
<li><a name="a982"></a><span class="src-key">function </span><a href="../nusoap/_nusoap_php.html#functionusleepWindows">usleepWindows</a><span class="src-sym">(</span><span class="src-var">$usec</span><span class="src-sym">)</span></li>
<li><a name="a983"></a><span class="src-sym">{</span></li>
<li><a name="a984"></a>    <span class="src-var">$start </span>= <a href="http://www.php.net/gettimeofday">gettimeofday</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a985"></a>    </li>
<li><a name="a986"></a>    do</li>
<li><a name="a987"></a>    <span class="src-sym">{</span></li>
<li><a name="a988"></a>        <span class="src-var">$stop </span>= <a href="http://www.php.net/gettimeofday">gettimeofday</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a989"></a>        <span class="src-var">$timePassed </span>= <span class="src-num">1000000 </span>* <span class="src-sym">(</span><span class="src-var">$stop</span><span class="src-sym">[</span><span class="src-str">'sec'</span><span class="src-sym">] </span>- <span class="src-var">$start</span><span class="src-sym">[</span><span class="src-str">'sec'</span><span class="src-sym">]</span><span class="src-sym">)</span></li>
<li><a name="a990"></a>        + <span class="src-var">$stop</span><span class="src-sym">[</span><span class="src-str">'usec'</span><span class="src-sym">] </span>- <span class="src-var">$start</span><span class="src-sym">[</span><span class="src-str">'usec'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a991"></a>    <span class="src-sym">}</span></li>
<li><a name="a992"></a>    <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$timePassed </span>&lt; <span class="src-var">$usec</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a993"></a><span class="src-sym">}</span></li>
<li><a name="a994"></a>&nbsp;</li>
<li><a name="a995"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a996"></a>&nbsp;</li>
<li><a name="a997"></a>&nbsp;</li>
<li><a name="a998"></a>&nbsp;</li>
<li><a name="a999"></a><span class="src-doc">/**</span></li>
<li><a name="a1000"></a><span class="src-doc">* Contains information for a SOAP fault.</span></li>
<li><a name="a1001"></a><span class="src-doc">* Mainly used for returning faults from deployed functions</span></li>
<li><a name="a1002"></a><span class="src-doc">* in a server instance.</span></li>
<li><a name="a1003"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a1004"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a1005"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1006"></a><span class="src-doc">*/</span></li>
<li><a name="a1007"></a><span class="src-key">class </span><a href="../nusoap/nusoap_fault.html">nusoap_fault</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a1008"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1009"></a><span class="src-doc">     * The fault code (client|server)</span></li>
<li><a name="a1010"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a1011"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a1012"></a><span class="src-doc">     */</span></li>
<li><a name="a1013"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_fault.html#var$faultcode">$faultcode</a><span class="src-sym">;</span></li>
<li><a name="a1014"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1015"></a><span class="src-doc">     * The fault actor</span></li>
<li><a name="a1016"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a1017"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a1018"></a><span class="src-doc">     */</span></li>
<li><a name="a1019"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_fault.html#var$faultactor">$faultactor</a><span class="src-sym">;</span></li>
<li><a name="a1020"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1021"></a><span class="src-doc">     * The fault string, a description of the fault</span></li>
<li><a name="a1022"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a1023"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a1024"></a><span class="src-doc">     */</span></li>
<li><a name="a1025"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_fault.html#var$faultstring">$faultstring</a><span class="src-sym">;</span></li>
<li><a name="a1026"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1027"></a><span class="src-doc">     * The fault detail, typically a string or array of string</span></li>
<li><a name="a1028"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a1029"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a1030"></a><span class="src-doc">     */</span></li>
<li><a name="a1031"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_fault.html#var$faultdetail">$faultdetail</a><span class="src-sym">;</span></li>
<li><a name="a1032"></a>&nbsp;</li>
<li><a name="a1033"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1034"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a1035"></a><span class="src-doc">    *</span></li>
<li><a name="a1036"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultcode </span><span class="src-doc">(SOAP-ENV:Client | SOAP-ENV:Server)</span></li>
<li><a name="a1037"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultactor </span><span class="src-doc">only used when msg routed between multiple actors</span></li>
<li><a name="a1038"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultstring </span><span class="src-doc">human readable error message</span></li>
<li><a name="a1039"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$faultdetail </span><span class="src-doc">detail, typically a string or array of string</span></li>
<li><a name="a1040"></a><span class="src-doc">    */</span></li>
<li><a name="a1041"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_fault.html#methodnusoap_fault">nusoap_fault</a><span class="src-sym">(</span><span class="src-var">$faultcode</span><span class="src-sym">,</span><span class="src-var">$faultactor</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$faultstring</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$faultdetail</span>=<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1042"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1043"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultcode">faultcode</a> = <span class="src-var">$faultcode</span><span class="src-sym">;</span></li>
<li><a name="a1044"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultactor">faultactor</a> = <span class="src-var">$faultactor</span><span class="src-sym">;</span></li>
<li><a name="a1045"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultstring">faultstring</a> = <span class="src-var">$faultstring</span><span class="src-sym">;</span></li>
<li><a name="a1046"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultdetail">faultdetail</a> = <span class="src-var">$faultdetail</span><span class="src-sym">;</span></li>
<li><a name="a1047"></a>    <span class="src-sym">}</span></li>
<li><a name="a1048"></a>&nbsp;</li>
<li><a name="a1049"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1050"></a><span class="src-doc">    * serialize a fault</span></li>
<li><a name="a1051"></a><span class="src-doc">    *</span></li>
<li><a name="a1052"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   The serialization of the fault instance.</span></li>
<li><a name="a1053"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a1054"></a><span class="src-doc">    */</span></li>
<li><a name="a1055"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_fault.html#methodserialize">serialize</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1056"></a>        <span class="src-var">$ns_string </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1057"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a> <span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1058"></a>            <span class="src-var">$ns_string </span>.= <span class="src-str">&quot;</span><span class="src-str">\n  xmlns:<span class="src-var">$k</span>=\&quot;<span class="src-var">$v</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1059"></a>        <span class="src-sym">}</span></li>
<li><a name="a1060"></a>        <span class="src-var">$return_msg </span>=</li>
<li><a name="a1061"></a>            <span class="src-str">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a>.<span class="src-str">'&quot;?&gt;'</span>.</li>
<li><a name="a1062"></a>            <span class="src-str">'&lt;SOAP-ENV:Envelope SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;'</span>.<span class="src-var">$ns_string</span>.<span class="src-str">&quot;&gt;\n&quot;</span>.</li>
<li><a name="a1063"></a>                <span class="src-str">'&lt;SOAP-ENV:Body&gt;'</span>.</li>
<li><a name="a1064"></a>                <span class="src-str">'&lt;SOAP-ENV:Fault&gt;'</span>.</li>
<li><a name="a1065"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultcode">faultcode</a><span class="src-sym">, </span><span class="src-str">'faultcode'</span><span class="src-sym">)</span>.</li>
<li><a name="a1066"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultactor">faultactor</a><span class="src-sym">, </span><span class="src-str">'faultactor'</span><span class="src-sym">)</span>.</li>
<li><a name="a1067"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultstring">faultstring</a><span class="src-sym">, </span><span class="src-str">'faultstring'</span><span class="src-sym">)</span>.</li>
<li><a name="a1068"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_fault.html#var$faultdetail">faultdetail</a><span class="src-sym">, </span><span class="src-str">'detail'</span><span class="src-sym">)</span>.</li>
<li><a name="a1069"></a>                <span class="src-str">'&lt;/SOAP-ENV:Fault&gt;'</span>.</li>
<li><a name="a1070"></a>                <span class="src-str">'&lt;/SOAP-ENV:Body&gt;'</span>.</li>
<li><a name="a1071"></a>            <span class="src-str">'&lt;/SOAP-ENV:Envelope&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a1072"></a>        <span class="src-key">return </span><span class="src-var">$return_msg</span><span class="src-sym">;</span></li>
<li><a name="a1073"></a>    <span class="src-sym">}</span></li>
<li><a name="a1074"></a><span class="src-sym">}</span></li>
<li><a name="a1075"></a>&nbsp;</li>
<li><a name="a1076"></a><span class="src-doc">/**</span></li>
<li><a name="a1077"></a><span class="src-doc"> * Backward compatibility</span></li>
<li><a name="a1078"></a><span class="src-doc"> */</span></li>
<li><a name="a1079"></a><span class="src-key">class </span><a href="../nusoap/soap_fault.html">soap_fault</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_fault.html#methodnusoap_fault">nusoap_fault</a> <span class="src-sym">{</span></li>
<li><a name="a1080"></a><span class="src-sym">}</span></li>
<li><a name="a1081"></a>&nbsp;</li>
<li><a name="a1082"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a1083"></a>&nbsp;</li>
<li><a name="a1084"></a>&nbsp;</li>
<li><a name="a1085"></a>&nbsp;</li>
<li><a name="a1086"></a><span class="src-doc">/**</span></li>
<li><a name="a1087"></a><span class="src-doc">* parses an XML Schema, allows access to it's data, other utility methods.</span></li>
<li><a name="a1088"></a><span class="src-doc">* imperfect, no validation... yet, but quite functional.</span></li>
<li><a name="a1089"></a><span class="src-doc">*</span></li>
<li><a name="a1090"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a1091"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a1092"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a1093"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a1094"></a><span class="src-doc">*/</span></li>
<li><a name="a1095"></a><span class="src-key">class </span><a href="../nusoap/nusoap_xmlschema.html">nusoap_xmlschema</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a>  <span class="src-sym">{</span></li>
<li><a name="a1096"></a>    </li>
<li><a name="a1097"></a>    <span class="src-comm">// files</span></li>
<li><a name="a1097"></a>    </li>
<li><a name="a1098"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$schema">$schema</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1099"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$xml">$xml</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1100"></a>    <span class="src-comm">// namespaces</span></li>
<li><a name="a1100"></a>    </li>
<li><a name="a1101"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$enclosingNamespaces">$enclosingNamespaces</a><span class="src-sym">;</span></li>
<li><a name="a1102"></a>    <span class="src-comm">// schema info</span></li>
<li><a name="a1102"></a>    </li>
<li><a name="a1103"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">$schemaInfo</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1104"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">$schemaTargetNamespace</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1105"></a>    <span class="src-comm">// types, elements, attributes defined by the schema</span></li>
<li><a name="a1105"></a>    </li>
<li><a name="a1106"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">$attributes</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1107"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">$complexTypes</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1108"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypeStack">$complexTypeStack</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1109"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">$currentComplexType</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a1110"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$elements">$elements</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1111"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$elementStack">$elementStack</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1112"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">$currentElement</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a1113"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">$simpleTypes</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1114"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypeStack">$simpleTypeStack</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1115"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">$currentSimpleType</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a1116"></a>    <span class="src-comm">// imports</span></li>
<li><a name="a1116"></a>    </li>
<li><a name="a1117"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$imports">$imports</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1118"></a>    <span class="src-comm">// parser vars</span></li>
<li><a name="a1118"></a>    </li>
<li><a name="a1119"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$parser">$parser</a><span class="src-sym">;</span></li>
<li><a name="a1120"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$position">$position</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a1121"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$depth">$depth</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a1122"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">$depth_array</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1123"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$message">$message</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1124"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">$defaultNamespace</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1125"></a>    </li>
<li><a name="a1126"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1127"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a1128"></a><span class="src-doc">    *</span></li>
<li><a name="a1129"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$schema </span><span class="src-doc">schema document URI</span></li>
<li><a name="a1130"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$xml </span><span class="src-doc">xml document URI</span></li>
<li><a name="a1131"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$namespaces </span><span class="src-doc">namespaces defined in enclosing XML</span></li>
<li><a name="a1132"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a1133"></a><span class="src-doc">    */</span></li>
<li><a name="a1134"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodnusoap_xmlschema">nusoap_xmlschema</a><span class="src-sym">(</span><span class="src-var">$schema</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$xml</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$namespaces</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1135"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1136"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'nusoap_xmlschema class instantiated, inside constructor'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1137"></a>        <span class="src-comm">// files</span></li>
<li><a name="a1138"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schema">schema</a> = <span class="src-var">$schema</span><span class="src-sym">;</span></li>
<li><a name="a1139"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$xml">xml</a> = <span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a1140"></a>&nbsp;</li>
<li><a name="a1141"></a>        <span class="src-comm">// namespaces</span></li>
<li><a name="a1142"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$enclosingNamespaces">enclosingNamespaces</a> = <span class="src-var">$namespaces</span><span class="src-sym">;</span></li>
<li><a name="a1143"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a> = <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">, </span><span class="src-var">$namespaces</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1144"></a>&nbsp;</li>
<li><a name="a1145"></a>        <span class="src-comm">// parse schema file</span></li>
<li><a name="a1146"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$schema </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1147"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'initial schema file: '</span>.<span class="src-var">$schema</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1148"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodparseFile">parseFile</a><span class="src-sym">(</span><span class="src-var">$schema</span><span class="src-sym">, </span><span class="src-str">'schema'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1149"></a>        <span class="src-sym">}</span></li>
<li><a name="a1150"></a>&nbsp;</li>
<li><a name="a1151"></a>        <span class="src-comm">// parse xml file</span></li>
<li><a name="a1152"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$xml </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1153"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'initial xml file: '</span>.<span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1154"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodparseFile">parseFile</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">, </span><span class="src-str">'xml'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1155"></a>        <span class="src-sym">}</span></li>
<li><a name="a1156"></a>&nbsp;</li>
<li><a name="a1157"></a>    <span class="src-sym">}</span></li>
<li><a name="a1158"></a>&nbsp;</li>
<li><a name="a1159"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1160"></a><span class="src-doc">    * parse an XML file</span></li>
<li><a name="a1161"></a><span class="src-doc">    *</span></li>
<li><a name="a1162"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$xml </span><span class="src-doc">path/URL to XML file</span></li>
<li><a name="a1163"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">(schema | xml)</span></li>
<li><a name="a1164"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">boolean </span></li>
<li><a name="a1165"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1166"></a><span class="src-doc">    */</span></li>
<li><a name="a1167"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodparseFile">parseFile</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">,</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1168"></a>        <span class="src-comm">// parse xml file</span></li>
<li><a name="a1169"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$xml </span>!= <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1170"></a>            <span class="src-var">$xmlStr </span>= <span class="src-sym">@</span><a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">&quot;&quot;</span><span class="src-sym">,</span><span class="src-sym">@</span><a href="http://www.php.net/file">file</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1171"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$xmlStr </span>== <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1172"></a>                <span class="src-var">$msg </span>= <span class="src-str">'Error reading XML from '</span>.<span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a1173"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1174"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1175"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1176"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1177"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">parsing <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1178"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodparseString">parseString</a><span class="src-sym">(</span><span class="src-var">$xmlStr</span><span class="src-sym">,</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1179"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">done parsing <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1180"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a1181"></a>            <span class="src-sym">}</span></li>
<li><a name="a1182"></a>        <span class="src-sym">}</span></li>
<li><a name="a1183"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1184"></a>    <span class="src-sym">}</span></li>
<li><a name="a1185"></a>&nbsp;</li>
<li><a name="a1186"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1187"></a><span class="src-doc">    * parse an XML string</span></li>
<li><a name="a1188"></a><span class="src-doc">    *</span></li>
<li><a name="a1189"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$xml </span><span class="src-doc">path or URL</span></li>
<li><a name="a1190"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">(schema|xml)</span></li>
<li><a name="a1191"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a1192"></a><span class="src-doc">    */</span></li>
<li><a name="a1193"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodparseString">parseString</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">,</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1194"></a>        <span class="src-comm">// parse xml string</span></li>
<li><a name="a1195"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$xml </span>!= <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1196"></a>&nbsp;</li>
<li><a name="a1197"></a>            <span class="src-comm">// Create an XML parser.</span></li>
<li><a name="a1198"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a> = <a href="http://www.php.net/xml_parser_create">xml_parser_create</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1199"></a>            <span class="src-comm">// Set the options for parsing the XML data.</span></li>
<li><a name="a1200"></a>            <a href="http://www.php.net/xml_parser_set_option">xml_parser_set_option</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-id">XML_OPTION_CASE_FOLDING</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1201"></a>&nbsp;</li>
<li><a name="a1202"></a>            <span class="src-comm">// Set the object for the parser.</span></li>
<li><a name="a1203"></a>            <a href="http://www.php.net/xml_set_object">xml_set_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1204"></a>&nbsp;</li>
<li><a name="a1205"></a>            <span class="src-comm">// Set the element handlers for the parser.</span></li>
<li><a name="a1206"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">&quot;schema&quot;</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1207"></a>                <a href="http://www.php.net/xml_set_element_handler">xml_set_element_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-str">'schemaStartElement'</span><span class="src-sym">,</span><span class="src-str">'schemaEndElement'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1208"></a>                <a href="http://www.php.net/xml_set_character_data_handler">xml_set_character_data_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">,</span><span class="src-str">'schemaCharacterData'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1209"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">&quot;xml&quot;</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1210"></a>                <a href="http://www.php.net/xml_set_element_handler">xml_set_element_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-str">'xmlStartElement'</span><span class="src-sym">,</span><span class="src-str">'xmlEndElement'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1211"></a>                <a href="http://www.php.net/xml_set_character_data_handler">xml_set_character_data_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">,</span><span class="src-str">'xmlCharacterData'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1212"></a>            <span class="src-sym">}</span></li>
<li><a name="a1213"></a>&nbsp;</li>
<li><a name="a1214"></a>            <span class="src-comm">// Parse the XML file.</span></li>
<li><a name="a1215"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/xml_parse">xml_parse</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">,</span><span class="src-var">$xml</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1216"></a>            <span class="src-comm">// Display an error message.</span></li>
<li><a name="a1217"></a>                <span class="src-var">$errstr </span>= <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'XML error parsing XML schema on line %d: %s'</span><span class="src-sym">,</span></li>
<li><a name="a1218"></a>                <a href="http://www.php.net/xml_get_current_line_number">xml_get_current_line_number</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a1219"></a>                <a href="http://www.php.net/xml_error_string">xml_error_string</a><span class="src-sym">(</span><a href="http://www.php.net/xml_get_error_code">xml_get_error_code</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">))</span></li>
<li><a name="a1220"></a>                <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1221"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1222"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;XML payload:\n&quot; </span>. <span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1223"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1224"></a>            <span class="src-sym">}</span></li>
<li><a name="a1225"></a>            </li>
<li><a name="a1226"></a>            <a href="http://www.php.net/xml_parser_free">xml_parser_free</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$parser">parser</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1227"></a>        <span class="src-sym">} </span><span class="src-key">else</span><span class="src-sym">{</span></li>
<li><a name="a1228"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no xml passed to parseString()!!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1229"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no xml passed to parseString()!!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1230"></a>        <span class="src-sym">}</span></li>
<li><a name="a1231"></a>    <span class="src-sym">}</span></li>
<li><a name="a1232"></a>&nbsp;</li>
<li><a name="a1233"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1234"></a><span class="src-doc">     * gets a type name for an unnamed type</span></li>
<li><a name="a1235"></a><span class="src-doc">     *</span></li>
<li><a name="a1236"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   Element name</span></li>
<li><a name="a1237"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   A type name for an unnamed type</span></li>
<li><a name="a1238"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a1239"></a><span class="src-doc">     */</span></li>
<li><a name="a1240"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodCreateTypeName">CreateTypeName</a><span class="src-sym">(</span><span class="src-var">$ename</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1241"></a>        <span class="src-var">$scope </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1242"></a>        <span class="src-key">for </span><span class="src-sym">(</span><span class="src-var">$i </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$i </span>&lt; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypeStack">complexTypeStack</a><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-var">$i</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1243"></a>            <span class="src-var">$scope </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypeStack">complexTypeStack</a><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">] </span>. <span class="src-str">'_'</span><span class="src-sym">;</span></li>
<li><a name="a1244"></a>        <span class="src-sym">}</span></li>
<li><a name="a1245"></a>        <span class="src-key">return </span><span class="src-var">$scope </span>. <span class="src-var">$ename </span>. <span class="src-str">'_ContainedType'</span><span class="src-sym">;</span></li>
<li><a name="a1246"></a>    <span class="src-sym">}</span></li>
<li><a name="a1247"></a>    </li>
<li><a name="a1248"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1249"></a><span class="src-doc">    * start-element handler</span></li>
<li><a name="a1250"></a><span class="src-doc">    *</span></li>
<li><a name="a1251"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a1252"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a1253"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$attrs </span><span class="src-doc">associative array of attributes</span></li>
<li><a name="a1254"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a1255"></a><span class="src-doc">    */</span></li>
<li><a name="a1256"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodschemaStartElement">schemaStartElement</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1257"></a>        </li>
<li><a name="a1258"></a>        <span class="src-comm">// position in the total number of elements, starting from 0</span></li>
<li><a name="a1259"></a>        <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$position">position</a>++<span class="src-sym">;</span></li>
<li><a name="a1260"></a>        <span class="src-var">$depth </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth">depth</a>++<span class="src-sym">;</span></li>
<li><a name="a1261"></a>        <span class="src-comm">// set self as current value for this depth</span></li>
<li><a name="a1262"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$depth</span><span class="src-sym">] </span>= <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a1263"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cdata' </span>=&gt; <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a1264"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$depth </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1265"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$depth </span>- <span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">;</span></li>
<li><a name="a1266"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1267"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1268"></a>        <span class="src-sym">}</span></li>
<li><a name="a1269"></a>&nbsp;</li>
<li><a name="a1270"></a>        <span class="src-comm">// get element prefix</span></li>
<li><a name="a1271"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1272"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a1273"></a>            <span class="src-var">$name </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1274"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1275"></a>            <span class="src-var">$prefix </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1276"></a>        <span class="src-sym">}</span></li>
<li><a name="a1277"></a>        </li>
<li><a name="a1278"></a>        <span class="src-comm">// loop thru attributes, expanding, and registering namespace declarations</span></li>
<li><a name="a1279"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1280"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1281"></a>                <span class="src-comm">// if ns declarations, add to class level array of valid namespaces</span></li>
<li><a name="a1282"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^xmlns/'</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1283"></a>                    <span class="src-comm">//$this-&gt;xdebug(&quot;$k: $v&quot;);</span></li>
<li><a name="a1284"></a>                    <span class="src-comm">//$this-&gt;xdebug('ns_prefix: '.$this-&gt;getPrefix($k));</span></li>
<li><a name="a1285"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ns_prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strrchr">strrchr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1286"></a>                        <span class="src-comm">//$this-&gt;xdebug(&quot;Add namespace[$ns_prefix] = $v&quot;);</span></li>
<li><a name="a1287"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$ns_prefix</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1288"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1289"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1290"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1291"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'ns'</span>.<span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">)</span>+<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1292"></a>                        <span class="src-sym">}</span></li>
<li><a name="a1293"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1294"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/2001/XMLSchema' </span>|| <span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/1999/XMLSchema' </span>|| <span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/2000/10/XMLSchema'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1295"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a> = <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1296"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsi'</span><span class="src-sym">] </span>= <span class="src-var">$v</span>.<span class="src-str">'-instance'</span><span class="src-sym">;</span></li>
<li><a name="a1297"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1298"></a>                <span class="src-sym">}</span></li>
<li><a name="a1299"></a>            <span class="src-sym">}</span></li>
<li><a name="a1300"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1301"></a>                <span class="src-comm">// expand each attribute</span></li>
<li><a name="a1302"></a>                <span class="src-var">$k </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">) </span>: <span class="src-var">$k</span><span class="src-sym">;</span></li>
<li><a name="a1303"></a>                <span class="src-var">$v </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>: <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1304"></a>                <span class="src-var">$eAttrs</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1305"></a>            <span class="src-sym">}</span></li>
<li><a name="a1306"></a>            <span class="src-var">$attrs </span>= <span class="src-var">$eAttrs</span><span class="src-sym">;</span></li>
<li><a name="a1307"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1308"></a>            <span class="src-var">$attrs </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1309"></a>        <span class="src-sym">}</span></li>
<li><a name="a1310"></a>        <span class="src-comm">// find status, register data</span></li>
<li><a name="a1311"></a>        <span class="src-key">switch</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1312"></a>            <span class="src-key">case </span><span class="src-str">'all'</span>:            <span class="src-comm">// (optional) compositor content for a complexType</span></li>
<li><a name="a1313"></a>            <span class="src-key">case </span><span class="src-str">'choice'</span>:</li>
<li><a name="a1314"></a>            <span class="src-key">case </span><span class="src-str">'group'</span>:</li>
<li><a name="a1315"></a>            <span class="src-key">case </span><span class="src-str">'sequence'</span>:</li>
<li><a name="a1316"></a>                <span class="src-comm">//$this-&gt;xdebug(&quot;compositor $name for currentComplexType: $this-&gt;currentComplexType and currentElement: $this-&gt;currentElement&quot;);</span></li>
<li><a name="a1317"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'compositor'</span><span class="src-sym">] </span>= <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a1318"></a>                <span class="src-comm">//if($name == 'all' || $name == 'sequence'){</span></li>
<li><a name="a1319"></a>                <span class="src-comm">//    $this-&gt;complexTypes[$this-&gt;currentComplexType]['phpType'] = 'struct';</span></li>
<li><a name="a1320"></a>                <span class="src-comm">//}</span></li>
<li><a name="a1321"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1322"></a>            <span class="src-key">case </span><span class="src-str">'attribute'</span>:    <span class="src-comm">// complexType attribute</span></li>
<li><a name="a1323"></a>                <span class="src-comm">//$this-&gt;xdebug(&quot;parsing attribute $attrs[name] $attrs[ref] of value: &quot;.$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']);</span></li>
<li><a name="a1324"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;parsing attribute:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1325"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1326"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1327"></a>                    <span class="src-comm">// TODO: handle globals</span></li>
<li><a name="a1328"></a>                    <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a><span class="src-sym">[</span><span class="src-str">'attributeFormDefault'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1329"></a>                <span class="src-sym">}</span></li>
<li><a name="a1330"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1331"></a>                    <span class="src-var">$v </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1332"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1333"></a>                        <span class="src-comm">// no namespace in arrayType attribute value...</span></li>
<li><a name="a1334"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1335"></a>                            <span class="src-comm">// ...so use the default</span></li>
<li><a name="a1336"></a>                            <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>. <span class="src-str">':' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1337"></a>                        <span class="src-sym">}</span></li>
<li><a name="a1338"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1339"></a>                <span class="src-sym">}</span></li>
<li><a name="a1340"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1341"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1342"></a>                    <span class="src-var">$aname </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1343"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">] </span>== <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/:arrayType'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1344"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1345"></a>                        <span class="src-var">$aname </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1346"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1347"></a>                        <span class="src-var">$aname </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1348"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1349"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1350"></a>                    <span class="src-var">$aname </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1351"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1352"></a>                <span class="src-sym">}</span></li>
<li><a name="a1353"></a>                </li>
<li><a name="a1354"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">)</span><span class="src-sym">{    </span><span class="src-comm">// This should *always* be</span></li>
<li><a name="a1355"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$aname</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1356"></a>                <span class="src-sym">}</span></li>
<li><a name="a1357"></a>                <span class="src-comm">// arrayType attribute</span></li>
<li><a name="a1358"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">) </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$aname</span><span class="src-sym">) </span>== <span class="src-str">'arrayType'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1359"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'array'</span><span class="src-sym">;</span></li>
<li><a name="a1360"></a>                    <span class="src-var">$prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$aname</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1361"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1362"></a>                        <span class="src-var">$v </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1363"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1364"></a>                        <span class="src-var">$v </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1365"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1366"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">'[,]'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1367"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'multidimensional'</span><span class="src-sym">] </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a1368"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1369"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">'['</span><span class="src-sym">))</span><span class="src-sym">; </span><span class="src-comm">// clip the []</span></li>
<li><a name="a1370"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$v</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1371"></a>                        <span class="src-var">$v </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a>.<span class="src-str">':'</span>.<span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1372"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1373"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a1374"></a>                <span class="src-sym">}</span></li>
<li><a name="a1375"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1376"></a>            <span class="src-key">case </span><span class="src-str">'complexContent'</span>:    <span class="src-comm">// (optional) content for a complexType</span></li>
<li><a name="a1377"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">do nothing for element <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1378"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1379"></a>            <span class="src-key">case </span><span class="src-str">'complexType'</span>:</li>
<li><a name="a1380"></a>                <a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypeStack">complexTypeStack</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1381"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1382"></a>                    <span class="src-comm">// TODO: what is the scope of named complexTypes that appear</span></li>
<li><a name="a1383"></a>                    <span class="src-comm">//       nested within other c complexTypes?</span></li>
<li><a name="a1384"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'processing named complexType '</span>.<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1385"></a>                    <span class="src-comm">//$this-&gt;currentElement = false;</span></li>
<li><a name="a1386"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1387"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1388"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'complexType'</span><span class="src-sym">;</span></li>
<li><a name="a1389"></a>                    <span class="src-comm">// This is for constructs like</span></li>
<li><a name="a1390"></a>                    <span class="src-comm">//           &lt;complexType name=&quot;ListOfString&quot; base=&quot;soap:Array&quot;&gt;</span></li>
<li><a name="a1391"></a>                    <span class="src-comm">//                &lt;sequence&gt;</span></li>
<li><a name="a1392"></a>                    <span class="src-comm">//                    &lt;element name=&quot;string&quot; type=&quot;xsd:string&quot;</span></li>
<li><a name="a1393"></a>                    <span class="src-comm">//                        minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;</span></li>
<li><a name="a1394"></a>                    <span class="src-comm">//                &lt;/sequence&gt;</span></li>
<li><a name="a1395"></a>                    <span class="src-comm">//            &lt;/complexType&gt;</span></li>
<li><a name="a1396"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/:Array$/'</span><span class="src-sym">,</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1397"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'complexType is unusual array'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1398"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'array'</span><span class="src-sym">;</span></li>
<li><a name="a1399"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1400"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'struct'</span><span class="src-sym">;</span></li>
<li><a name="a1401"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1402"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1403"></a>                    <span class="src-var">$name </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodCreateTypeName">CreateTypeName</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1404"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'processing unnamed complexType for element ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> . <span class="src-str">' named ' </span>. <span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1405"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> = <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a1406"></a>                    <span class="src-comm">//$this-&gt;currentElement = false;</span></li>
<li><a name="a1407"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1408"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'complexType'</span><span class="src-sym">;</span></li>
<li><a name="a1409"></a>                    <span class="src-comm">// This is for constructs like</span></li>
<li><a name="a1410"></a>                    <span class="src-comm">//           &lt;complexType name=&quot;ListOfString&quot; base=&quot;soap:Array&quot;&gt;</span></li>
<li><a name="a1411"></a>                    <span class="src-comm">//                &lt;sequence&gt;</span></li>
<li><a name="a1412"></a>                    <span class="src-comm">//                    &lt;element name=&quot;string&quot; type=&quot;xsd:string&quot;</span></li>
<li><a name="a1413"></a>                    <span class="src-comm">//                        minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;</span></li>
<li><a name="a1414"></a>                    <span class="src-comm">//                &lt;/sequence&gt;</span></li>
<li><a name="a1415"></a>                    <span class="src-comm">//            &lt;/complexType&gt;</span></li>
<li><a name="a1416"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/:Array$/'</span><span class="src-sym">,</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1417"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'complexType is unusual array'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1418"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'array'</span><span class="src-sym">;</span></li>
<li><a name="a1419"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1420"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'struct'</span><span class="src-sym">;</span></li>
<li><a name="a1421"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1422"></a>                <span class="src-sym">}</span></li>
<li><a name="a1423"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'simpleContent'</span><span class="src-sym">] </span>= <span class="src-str">'false'</span><span class="src-sym">;</span></li>
<li><a name="a1424"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1425"></a>            <span class="src-key">case </span><span class="src-str">'element'</span>:</li>
<li><a name="a1426"></a>                <a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elementStack">elementStack</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1427"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1428"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1429"></a>                        <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a><span class="src-sym">[</span><span class="src-str">'elementFormDefault'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1430"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1431"></a>                        <span class="src-comm">// global</span></li>
<li><a name="a1432"></a>                        <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>= <span class="src-str">'qualified'</span><span class="src-sym">;</span></li>
<li><a name="a1433"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1434"></a>                <span class="src-sym">}</span></li>
<li><a name="a1435"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1436"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;processing typed element &quot;</span>.<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span>.<span class="src-str">&quot; of type &quot;</span>.<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1437"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1438"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1439"></a>                            <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$defaultNamespace">defaultNamespace</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>. <span class="src-str">':' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1440"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'used default namespace to make type ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1441"></a>                        <span class="src-sym">}</span></li>
<li><a name="a1442"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1443"></a>                    <span class="src-comm">// This is for constructs like</span></li>
<li><a name="a1444"></a>                    <span class="src-comm">//           &lt;complexType name=&quot;ListOfString&quot; base=&quot;soap:Array&quot;&gt;</span></li>
<li><a name="a1445"></a>                    <span class="src-comm">//                &lt;sequence&gt;</span></li>
<li><a name="a1446"></a>                    <span class="src-comm">//                    &lt;element name=&quot;string&quot; type=&quot;xsd:string&quot;</span></li>
<li><a name="a1447"></a>                    <span class="src-comm">//                        minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;</span></li>
<li><a name="a1448"></a>                    <span class="src-comm">//                &lt;/sequence&gt;</span></li>
<li><a name="a1449"></a>                    <span class="src-comm">//            &lt;/complexType&gt;</span></li>
<li><a name="a1450"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1451"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'arrayType for unusual array is ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1452"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1453"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1454"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1455"></a>                    <span class="src-var">$ename </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1456"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1457"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;processing element as ref to &quot;</span>.<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1458"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> = <span class="src-str">&quot;ref to &quot;</span>.<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1459"></a>                    <span class="src-var">$ename </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1460"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1461"></a>                    <span class="src-var">$type </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodCreateTypeName">CreateTypeName</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> . <span class="src-str">'_' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1462"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;processing untyped element &quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">' type ' </span>. <span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1463"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1464"></a>                    <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> . <span class="src-str">':' </span>. <span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a1465"></a>                    <span class="src-var">$ename </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1466"></a>                <span class="src-sym">}</span></li>
<li><a name="a1467"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$ename</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1468"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">add element <span class="src-var">$ename</span> to complexType <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1469"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$ename</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1470"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1471"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">add element <span class="src-var">$ename</span> to elements array</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1472"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1473"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'element'</span><span class="src-sym">;</span></li>
<li><a name="a1474"></a>                <span class="src-sym">}</span></li>
<li><a name="a1475"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1476"></a>            <span class="src-key">case </span><span class="src-str">'enumeration'</span>:    <span class="src-comm">//    restriction value list member</span></li>
<li><a name="a1477"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'enumeration ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1478"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1479"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'enumeration'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1480"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1481"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'enumeration'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1482"></a>                <span class="src-sym">}</span></li>
<li><a name="a1483"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1484"></a>            <span class="src-key">case </span><span class="src-str">'extension'</span>:    <span class="src-comm">// simpleContent or complexContent type extension</span></li>
<li><a name="a1485"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'extension ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1486"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1487"></a>                    <span class="src-var">$ns </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1488"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ns </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1489"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> . <span class="src-str">':' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1490"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1491"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1492"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1493"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1494"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'no current complexType to set extensionBase'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1495"></a>                <span class="src-sym">}</span></li>
<li><a name="a1496"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1497"></a>            <span class="src-key">case </span><span class="src-str">'import'</span>:</li>
<li><a name="a1498"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1499"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'import namespace ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>. <span class="src-str">' from ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1500"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$imports">imports</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1501"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1502"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'import namespace ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1503"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$imports">imports</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1504"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1505"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'ns'</span>.<span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">)</span>+<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1506"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1507"></a>                <span class="src-sym">}</span></li>
<li><a name="a1508"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1509"></a>            <span class="src-key">case </span><span class="src-str">'include'</span>:</li>
<li><a name="a1510"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1511"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'include into namespace ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> . <span class="src-str">' from ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1512"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$imports">imports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'schemaLocation'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1513"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1514"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'ignoring invalid XML Schema construct: include without schemaLocation attribute'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1515"></a>                <span class="src-sym">}</span></li>
<li><a name="a1516"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1517"></a>            <span class="src-key">case </span><span class="src-str">'list'</span>:    <span class="src-comm">// simpleType value list</span></li>
<li><a name="a1518"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">do nothing for element <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1519"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1520"></a>            <span class="src-key">case </span><span class="src-str">'restriction'</span>:    <span class="src-comm">// simpleType, simpleContent or complexContent value restriction</span></li>
<li><a name="a1521"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'restriction ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1522"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1523"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1524"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1525"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'restrictionBase'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1526"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'base'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>== <span class="src-str">':Array'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1527"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'array'</span><span class="src-sym">;</span></li>
<li><a name="a1528"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1529"></a>                <span class="src-sym">}</span></li>
<li><a name="a1530"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1531"></a>            <span class="src-key">case </span><span class="src-str">'schema'</span>:</li>
<li><a name="a1532"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a> = <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1533"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a><span class="src-sym">[</span><span class="src-str">'schemaVersion'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1534"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'targetNamespace'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1535"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'targetNamespace'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1536"></a>                <span class="src-sym">}</span></li>
<li><a name="a1537"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elementFormDefault'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1538"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a><span class="src-sym">[</span><span class="src-str">'elementFormDefault'</span><span class="src-sym">] </span>= <span class="src-str">'unqualified'</span><span class="src-sym">;</span></li>
<li><a name="a1539"></a>                <span class="src-sym">}</span></li>
<li><a name="a1540"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attributeFormDefault'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1541"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a><span class="src-sym">[</span><span class="src-str">'attributeFormDefault'</span><span class="src-sym">] </span>= <span class="src-str">'unqualified'</span><span class="src-sym">;</span></li>
<li><a name="a1542"></a>                <span class="src-sym">}</span></li>
<li><a name="a1543"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1544"></a>            <span class="src-key">case </span><span class="src-str">'simpleContent'</span>:    <span class="src-comm">// (optional) content for a complexType</span></li>
<li><a name="a1545"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">) </span><span class="src-sym">{    </span><span class="src-comm">// This should *always* be</span></li>
<li><a name="a1546"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'simpleContent'</span><span class="src-sym">] </span>= <span class="src-str">'true'</span><span class="src-sym">;</span></li>
<li><a name="a1547"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1548"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">do nothing for element <span class="src-var">$name</span> because there is no current complexType</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1549"></a>                <span class="src-sym">}</span></li>
<li><a name="a1550"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1551"></a>            <span class="src-key">case </span><span class="src-str">'simpleType'</span>:</li>
<li><a name="a1552"></a>                <a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypeStack">simpleTypeStack</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1553"></a>                <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1554"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;processing simpleType for name &quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1555"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1556"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1557"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'simpleType'</span><span class="src-sym">;</span></li>
<li><a name="a1558"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'scalar'</span><span class="src-sym">;</span></li>
<li><a name="a1559"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1560"></a>                    <span class="src-var">$name </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodCreateTypeName">CreateTypeName</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> . <span class="src-str">'_' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1561"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'processing unnamed simpleType for element ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> . <span class="src-str">' named ' </span>. <span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1562"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a> = <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a1563"></a>                    <span class="src-comm">//$this-&gt;currentElement = false;</span></li>
<li><a name="a1564"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a1565"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'scalar'</span><span class="src-sym">;</span></li>
<li><a name="a1566"></a>                <span class="src-sym">}</span></li>
<li><a name="a1567"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1568"></a>            <span class="src-key">case </span><span class="src-str">'union'</span>:    <span class="src-comm">// simpleType type list</span></li>
<li><a name="a1569"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">do nothing for element <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1570"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a1571"></a>            <span class="src-key">default</span>:</li>
<li><a name="a1572"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">do not have any logic to process element <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1573"></a>        <span class="src-sym">}</span></li>
<li><a name="a1574"></a>    <span class="src-sym">}</span></li>
<li><a name="a1575"></a>&nbsp;</li>
<li><a name="a1576"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1577"></a><span class="src-doc">    * end-element handler</span></li>
<li><a name="a1578"></a><span class="src-doc">    *</span></li>
<li><a name="a1579"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a1580"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a1581"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a1582"></a><span class="src-doc">    */</span></li>
<li><a name="a1583"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodschemaEndElement">schemaEndElement</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1584"></a>        <span class="src-comm">// bring depth down a notch</span></li>
<li><a name="a1585"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth">depth</a>--<span class="src-sym">;</span></li>
<li><a name="a1586"></a>        <span class="src-comm">// position of current element is equal to the last value left in depth_array for my depth</span></li>
<li><a name="a1587"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth">depth</a><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1588"></a>            <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth">depth</a><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1589"></a>        <span class="src-sym">}</span></li>
<li><a name="a1590"></a>        <span class="src-comm">// get element prefix</span></li>
<li><a name="a1591"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1592"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a1593"></a>            <span class="src-var">$name </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1594"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1595"></a>            <span class="src-var">$prefix </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1596"></a>        <span class="src-sym">}</span></li>
<li><a name="a1597"></a>        <span class="src-comm">// move on...</span></li>
<li><a name="a1598"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'complexType'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1599"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'done processing complexType ' </span>. <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> : <span class="src-str">'(unknown)'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1600"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1601"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentComplexType">currentComplexType</a> = <a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypeStack">complexTypeStack</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1602"></a>            <span class="src-comm">//$this-&gt;currentElement = false;</span></li>
<li><a name="a1603"></a>        <span class="src-sym">}</span></li>
<li><a name="a1604"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'element'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1605"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'done processing element ' </span>. <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> : <span class="src-str">'(unknown)'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1606"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentElement">currentElement</a> = <a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elementStack">elementStack</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1607"></a>        <span class="src-sym">}</span></li>
<li><a name="a1608"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'simpleType'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1609"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">'done processing simpleType ' </span>. <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a> ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a> : <span class="src-str">'(unknown)'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1610"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1611"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$currentSimpleType">currentSimpleType</a> = <a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypeStack">simpleTypeStack</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1612"></a>        <span class="src-sym">}</span></li>
<li><a name="a1613"></a>    <span class="src-sym">}</span></li>
<li><a name="a1614"></a>&nbsp;</li>
<li><a name="a1615"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1616"></a><span class="src-doc">    * element content handler</span></li>
<li><a name="a1617"></a><span class="src-doc">    *</span></li>
<li><a name="a1618"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a1619"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">element content</span></li>
<li><a name="a1620"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a1621"></a><span class="src-doc">    */</span></li>
<li><a name="a1622"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodschemaCharacterData">schemaCharacterData</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1623"></a>        <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$depth">depth</a> - <span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1624"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">] </span>.= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a1625"></a>    <span class="src-sym">}</span></li>
<li><a name="a1626"></a>&nbsp;</li>
<li><a name="a1627"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1628"></a><span class="src-doc">    * serialize the schema</span></li>
<li><a name="a1629"></a><span class="src-doc">    *</span></li>
<li><a name="a1630"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a1631"></a><span class="src-doc">    */</span></li>
<li><a name="a1632"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodserializeSchema">serializeSchema</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1633"></a>&nbsp;</li>
<li><a name="a1634"></a>        <span class="src-var">$schemaPrefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1635"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1636"></a>        <span class="src-comm">// imports</span></li>
<li><a name="a1637"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$imports">imports</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1638"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$imports">imports</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$list</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1639"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$list </span><span class="src-key">as </span><span class="src-var">$ii</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1640"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ii</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1641"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:import location=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$ii</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; namespace=&quot;' </span>. <span class="src-var">$ns </span>. <span class="src-str">&quot;\&quot; /&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1642"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1643"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:import namespace=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$ns </span>. <span class="src-str">&quot;\&quot; /&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1644"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1645"></a>                <span class="src-sym">}</span></li>
<li><a name="a1646"></a>            <span class="src-sym">} </span></li>
<li><a name="a1647"></a>        <span class="src-sym">} </span></li>
<li><a name="a1648"></a>        <span class="src-comm">// complex types</span></li>
<li><a name="a1649"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a> <span class="src-key">as </span><span class="src-var">$typeName </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1650"></a>            <span class="src-var">$contentStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1651"></a>            <span class="src-comm">// serialize child elements</span></li>
<li><a name="a1652"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1653"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$element </span>=&gt; <span class="src-var">$eParts</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1654"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1655"></a>                        <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str">   &lt;<span class="src-var">$schemaPrefix</span>:element ref=\&quot;<span class="src-var">$element</span>\&quot;/&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1656"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1657"></a>                        <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str">   &lt;<span class="src-var">$schemaPrefix</span>:element name=\&quot;<span class="src-var">$element</span>\&quot; type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1658"></a>                        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$eParts </span><span class="src-key">as </span><span class="src-var">$aName </span>=&gt; <span class="src-var">$aValue</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1659"></a>                            <span class="src-comm">// handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable</span></li>
<li><a name="a1660"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$aName </span>!= <span class="src-str">'name' </span>&amp;&amp; <span class="src-var">$aName </span>!= <span class="src-str">'type'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1661"></a>                                <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$aName</span>=\&quot;<span class="src-var">$aValue</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1662"></a>                            <span class="src-sym">}</span></li>
<li><a name="a1663"></a>                        <span class="src-sym">}</span></li>
<li><a name="a1664"></a>                        <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;/&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1665"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1666"></a>                <span class="src-sym">}</span></li>
<li><a name="a1667"></a>                <span class="src-comm">// compositor wraps elements</span></li>
<li><a name="a1668"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'compositor'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'compositor'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1669"></a>                    <span class="src-var">$contentStr </span>= <span class="src-str">&quot;</span><span class="src-str">  &lt;<span class="src-var">$schemaPrefix</span>:<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-id">compositor</span><span class="src-sym">]</span>&gt;\n</span><span class="src-str">&quot;</span>.<span class="src-var">$contentStr</span>.<span class="src-str">&quot;</span><span class="src-str">  &lt;/<span class="src-var">$schemaPrefix</span>:<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-id">compositor</span><span class="src-sym">]</span>&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1670"></a>                <span class="src-sym">}</span></li>
<li><a name="a1671"></a>            <span class="src-sym">}</span></li>
<li><a name="a1672"></a>            <span class="src-comm">// attributes</span></li>
<li><a name="a1673"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt;= <span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1674"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$attr </span>=&gt; <span class="src-var">$aParts</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1675"></a>                    <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str">    &lt;<span class="src-var">$schemaPrefix</span>:attribute</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1676"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$aParts </span><span class="src-key">as </span><span class="src-var">$a </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1677"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$a </span>== <span class="src-str">'ref' </span>|| <span class="src-var">$a </span>== <span class="src-str">'type'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1678"></a>                            <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$a</span>=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span>.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a1679"></a>                        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$a </span>== <span class="src-str">'http://schemas.xmlsoap.org/wsdl/:arrayType'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1680"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$usedNamespaces">usedNamespaces</a><span class="src-sym">[</span><span class="src-str">'wsdl'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'wsdl'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1681"></a>                            <span class="src-var">$contentStr </span>.= <span class="src-str">' wsdl:arrayType=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span>.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a1682"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1683"></a>                            <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$a</span>=\&quot;<span class="src-var">$v</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1684"></a>                        <span class="src-sym">}</span></li>
<li><a name="a1685"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1686"></a>                    <span class="src-var">$contentStr </span>.= <span class="src-str">&quot;/&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1687"></a>                <span class="src-sym">}</span></li>
<li><a name="a1688"></a>            <span class="src-sym">}</span></li>
<li><a name="a1689"></a>            <span class="src-comm">// if restriction</span></li>
<li><a name="a1690"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'restrictionBase'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'restrictionBase'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1691"></a>                <span class="src-var">$contentStr </span>= <span class="src-str">&quot;</span><span class="src-str">   &lt;<span class="src-var">$schemaPrefix</span>:restriction base=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'restrictionBase'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;\n&quot;</span>.<span class="src-var">$contentStr</span>.<span class="src-str">&quot;</span><span class="src-str">   &lt;/<span class="src-var">$schemaPrefix</span>:restriction&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1692"></a>                <span class="src-comm">// complex or simple content</span></li>
<li><a name="a1693"></a>                <span class="src-key">if </span><span class="src-sym">((</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span>|| <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1694"></a>                    <span class="src-var">$contentStr </span>= <span class="src-str">&quot;</span><span class="src-str">  &lt;<span class="src-var">$schemaPrefix</span>:complexContent&gt;\n</span><span class="src-str">&quot;</span>.<span class="src-var">$contentStr</span>.<span class="src-str">&quot;</span><span class="src-str">  &lt;/<span class="src-var">$schemaPrefix</span>:complexContent&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1695"></a>                <span class="src-sym">}</span></li>
<li><a name="a1696"></a>            <span class="src-sym">}</span></li>
<li><a name="a1697"></a>            <span class="src-comm">// finalize complex type</span></li>
<li><a name="a1698"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$contentStr </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1699"></a>                <span class="src-var">$contentStr </span>= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:complexType name=\&quot;<span class="src-var">$typeName</span>\&quot;&gt;\n</span><span class="src-str">&quot;</span>.<span class="src-var">$contentStr</span>.<span class="src-str">&quot;</span><span class="src-str"> &lt;/<span class="src-var">$schemaPrefix</span>:complexType&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1700"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1701"></a>                <span class="src-var">$contentStr </span>= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:complexType name=\&quot;<span class="src-var">$typeName</span>\&quot;/&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1702"></a>            <span class="src-sym">}</span></li>
<li><a name="a1703"></a>            <span class="src-var">$xml </span>.= <span class="src-var">$contentStr</span><span class="src-sym">;</span></li>
<li><a name="a1704"></a>        <span class="src-sym">}</span></li>
<li><a name="a1705"></a>        <span class="src-comm">// simple types</span></li>
<li><a name="a1706"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1707"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a> <span class="src-key">as </span><span class="src-var">$typeName </span>=&gt; <span class="src-var">$eParts</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1708"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:simpleType name=\&quot;<span class="src-var">$typeName</span>\&quot;&gt;\n  &lt;<span class="src-var">$schemaPrefix</span>:restriction base=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1709"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'enumeration'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1710"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'enumeration'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$e</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1711"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">  &lt;<span class="src-var">$schemaPrefix</span>:enumeration value=\&quot;<span class="src-var">$e</span>\&quot;/&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1712"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1713"></a>                <span class="src-sym">}</span></li>
<li><a name="a1714"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">  &lt;/<span class="src-var">$schemaPrefix</span>:restriction&gt;\n &lt;/<span class="src-var">$schemaPrefix</span>:simpleType&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1715"></a>            <span class="src-sym">}</span></li>
<li><a name="a1716"></a>        <span class="src-sym">}</span></li>
<li><a name="a1717"></a>        <span class="src-comm">// elements</span></li>
<li><a name="a1718"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1719"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a> <span class="src-key">as </span><span class="src-var">$element </span>=&gt; <span class="src-var">$eParts</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1720"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:element name=\&quot;<span class="src-var">$element</span>\&quot; type=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$eParts</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;/&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1721"></a>            <span class="src-sym">}</span></li>
<li><a name="a1722"></a>        <span class="src-sym">}</span></li>
<li><a name="a1723"></a>        <span class="src-comm">// attributes</span></li>
<li><a name="a1724"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1725"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a> <span class="src-key">as </span><span class="src-var">$attr </span>=&gt; <span class="src-var">$aParts</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1726"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> &lt;<span class="src-var">$schemaPrefix</span>:attribute name=\&quot;<span class="src-var">$attr</span>\&quot; type=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">contractQName</span><span class="src-sym">(</span><span class="src-var">$aParts</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;\&quot;\n/&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1727"></a>            <span class="src-sym">}</span></li>
<li><a name="a1728"></a>        <span class="src-sym">}</span></li>
<li><a name="a1729"></a>        <span class="src-comm">// finish 'er up</span></li>
<li><a name="a1730"></a>        <span class="src-var">$attr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a1731"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaInfo">schemaInfo</a> <span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1732"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'elementFormDefault' </span>|| <span class="src-var">$k </span>== <span class="src-str">'attributeFormDefault'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1733"></a>                <span class="src-var">$attr </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$k</span>=\&quot;<span class="src-var">$v</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1734"></a>            <span class="src-sym">}</span></li>
<li><a name="a1735"></a>        <span class="src-sym">}</span></li>
<li><a name="a1736"></a>        <span class="src-var">$el </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$schemaPrefix</span>:schema<span class="src-var">$attr</span> targetNamespace=\&quot;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a>\&quot;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1737"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><a href="http://www.php.net/array_diff">array_diff</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$usedNamespaces">usedNamespaces</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$enclosingNamespaces">enclosingNamespaces</a><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$nsp </span>=&gt; <span class="src-var">$ns</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1738"></a>            <span class="src-var">$el </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$nsp</span>=\&quot;<span class="src-var">$ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1739"></a>        <span class="src-sym">}</span></li>
<li><a name="a1740"></a>        <span class="src-var">$xml </span>= <span class="src-var">$el </span>. <span class="src-str">&quot;&gt;\n&quot;</span>.<span class="src-var">$xml</span>.<span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$schemaPrefix</span>:schema&gt;\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1741"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a1742"></a>    <span class="src-sym">}</span></li>
<li><a name="a1743"></a>&nbsp;</li>
<li><a name="a1744"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1745"></a><span class="src-doc">    * adds debug data to the clas level debug string</span></li>
<li><a name="a1746"></a><span class="src-doc">    *</span></li>
<li><a name="a1747"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$string </span><span class="src-doc">debug data</span></li>
<li><a name="a1748"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a1749"></a><span class="src-doc">    */</span></li>
<li><a name="a1750"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1751"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'&lt;' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> . <span class="src-str">'&gt; '</span>.<span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1752"></a>    <span class="src-sym">}</span></li>
<li><a name="a1753"></a>&nbsp;</li>
<li><a name="a1754"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1755"></a><span class="src-doc">    * get the PHP type of a user defined type in the schema</span></li>
<li><a name="a1756"></a><span class="src-doc">    * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays</span></li>
<li><a name="a1757"></a><span class="src-doc">    * returns false if no type exists, or not w/ the given namespace</span></li>
<li><a name="a1758"></a><span class="src-doc">    * else returns a string that is either a native php type, or 'struct'</span></li>
<li><a name="a1759"></a><span class="src-doc">    *</span></li>
<li><a name="a1760"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">name of defined type</span></li>
<li><a name="a1761"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$ns </span><span class="src-doc">namespace of type</span></li>
<li><a name="a1762"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span></li>
<li><a name="a1763"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1764"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a1765"></a><span class="src-doc">    */</span></li>
<li><a name="a1766"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodgetPHPType">getPHPType</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1767"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1768"></a>            <span class="src-comm">//print &quot;found type '$type' and ns $ns in typemap&lt;br&gt;&quot;;</span></li>
<li><a name="a1769"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1770"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1771"></a>            <span class="src-comm">//print &quot;getting type '$type' and ns $ns from complexTypes array&lt;br&gt;&quot;;</span></li>
<li><a name="a1772"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1773"></a>        <span class="src-sym">}</span></li>
<li><a name="a1774"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1775"></a>    <span class="src-sym">}</span></li>
<li><a name="a1776"></a>&nbsp;</li>
<li><a name="a1777"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1778"></a><span class="src-doc">    * returns an associative array of information about a given type</span></li>
<li><a name="a1779"></a><span class="src-doc">    * returns false if no type exists by the given name</span></li>
<li><a name="a1780"></a><span class="src-doc">    *</span></li>
<li><a name="a1781"></a><span class="src-doc">    *    For a complexType typeDef = array(</span></li>
<li><a name="a1782"></a><span class="src-doc">    *    'restrictionBase' =&gt; '',</span></li>
<li><a name="a1783"></a><span class="src-doc">    *    'phpType' =&gt; '',</span></li>
<li><a name="a1784"></a><span class="src-doc">    *    'compositor' =&gt; '(sequence|all)',</span></li>
<li><a name="a1785"></a><span class="src-doc">    *    'elements' =&gt; array(), // refs to elements array</span></li>
<li><a name="a1786"></a><span class="src-doc">    *    'attrs' =&gt; array() // refs to attributes array</span></li>
<li><a name="a1787"></a><span class="src-doc">    *    ... and so on (see addComplexType)</span></li>
<li><a name="a1788"></a><span class="src-doc">    *    )</span></li>
<li><a name="a1789"></a><span class="src-doc">    *</span></li>
<li><a name="a1790"></a><span class="src-doc">    *   For simpleType or element, the array has different keys.</span></li>
<li><a name="a1791"></a><span class="src-doc">    *</span></li>
<li><a name="a1792"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span></li>
<li><a name="a1793"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span></li>
<li><a name="a1794"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1795"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> addComplexType</span></li>
<li><a name="a1796"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> addSimpleType</span></li>
<li><a name="a1797"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> addElement</span></li>
<li><a name="a1798"></a><span class="src-doc">    */</span></li>
<li><a name="a1799"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1800"></a>        <span class="src-comm">//$this-&gt;debug(&quot;in getTypeDef for type $type&quot;);</span></li>
<li><a name="a1801"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">'^'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1802"></a>            <span class="src-var">$is_element </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a1803"></a>            <span class="src-var">$type </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1804"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1805"></a>            <span class="src-var">$is_element </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a1806"></a>        <span class="src-sym">}</span></li>
<li><a name="a1807"></a>&nbsp;</li>
<li><a name="a1808"></a>        <span class="src-key">if</span><span class="src-sym">((</span><span class="src-sym">! </span><span class="src-var">$is_element</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1809"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found complexType <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1810"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1811"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">((</span><span class="src-sym">! </span><span class="src-var">$is_element</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1812"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found simpleType <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1813"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1814"></a>                <span class="src-comm">// get info for type to tack onto the simple type</span></li>
<li><a name="a1815"></a>                <span class="src-comm">// TODO: can this ever really apply (i.e. what is a simpleType really?)</span></li>
<li><a name="a1816"></a>                <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1817"></a>                <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1818"></a>                <span class="src-var">$etype </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1819"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1820"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found type for simpleType <span class="src-var">$type</span>:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1821"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1822"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1823"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1824"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1825"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1826"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1827"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1828"></a>                <span class="src-sym">}</span></li>
<li><a name="a1829"></a>            <span class="src-sym">}</span></li>
<li><a name="a1830"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1831"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1832"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found element <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1833"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1834"></a>                <span class="src-comm">// get info for type to tack onto the element</span></li>
<li><a name="a1835"></a>                <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1836"></a>                <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1837"></a>                <span class="src-var">$etype </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1838"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1839"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found type for element <span class="src-var">$type</span>:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1840"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a1841"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1842"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1843"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1844"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1845"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1846"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1847"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1848"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1849"></a>                    <span class="src-sym">}</span></li>
<li><a name="a1850"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$ns </span>== <span class="src-str">'http://www.w3.org/2001/XMLSchema'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1851"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, element <span class="src-var">$type</span> is an XSD type</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1852"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'scalar'</span><span class="src-sym">;</span></li>
<li><a name="a1853"></a>                <span class="src-sym">}</span></li>
<li><a name="a1854"></a>            <span class="src-sym">}</span></li>
<li><a name="a1855"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1856"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1857"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, found attribute <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1858"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$attributes">attributes</a><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a1859"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/_ContainedType$/'</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a1860"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, have an untyped element <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1861"></a>            <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'simpleType'</span><span class="src-sym">;</span></li>
<li><a name="a1862"></a>            <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-str">'scalar'</span><span class="src-sym">;</span></li>
<li><a name="a1863"></a>            <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-str">'http://www.w3.org/2001/XMLSchema:string'</span><span class="src-sym">;</span></li>
<li><a name="a1864"></a>            <span class="src-key">return </span><span class="src-var">$typeDef</span><span class="src-sym">;</span></li>
<li><a name="a1865"></a>        <span class="src-sym">}</span></li>
<li><a name="a1866"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef, did not find <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1867"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1868"></a>    <span class="src-sym">}</span></li>
<li><a name="a1869"></a>&nbsp;</li>
<li><a name="a1870"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1871"></a><span class="src-doc">    * returns a sample serialization of a given type, or false if no type by the given name</span></li>
<li><a name="a1872"></a><span class="src-doc">    *</span></li>
<li><a name="a1873"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">name of type</span></li>
<li><a name="a1874"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span></li>
<li><a name="a1875"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1876"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a1877"></a><span class="src-doc">    */</span></li>
<li><a name="a1878"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodserializeTypeDef">serializeTypeDef</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1879"></a>        <span class="src-comm">//print &quot;in sTD() for type $type&lt;br&gt;&quot;;</span></li>
<li><a name="a1880"></a>    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$typeDef </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1881"></a>        <span class="src-var">$str </span>.= <span class="src-str">'&lt;'</span>.<span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a1882"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1883"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$attName </span>=&gt; <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1884"></a>            <span class="src-var">$str </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$attName</span>=\&quot;{type = </span><span class="src-str">&quot;</span>.<span class="src-var">$data</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span>.<span class="src-str">&quot;}\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1885"></a>        <span class="src-sym">}</span></li>
<li><a name="a1886"></a>        <span class="src-sym">}</span></li>
<li><a name="a1887"></a>        <span class="src-var">$str </span>.= <span class="src-str">&quot; xmlns=\&quot;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schema">schema</a><span class="src-sym">[</span><span class="src-str">'targetNamespace'</span><span class="src-sym">]</span>.<span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1888"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1889"></a>        <span class="src-var">$str </span>.= <span class="src-str">&quot;&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1890"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$element </span>=&gt; <span class="src-var">$eData</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1891"></a>            <span class="src-var">$str </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodserializeTypeDef">serializeTypeDef</a><span class="src-sym">(</span><span class="src-var">$element</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1892"></a>        <span class="src-sym">}</span></li>
<li><a name="a1893"></a>        <span class="src-var">$str </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$type</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1894"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>== <span class="src-str">'element'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a1895"></a>        <span class="src-var">$str </span>.= <span class="src-str">&quot;</span><span class="src-str">&gt;&lt;/<span class="src-var">$type</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1896"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1897"></a>        <span class="src-var">$str </span>.= <span class="src-str">&quot;/&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1898"></a>        <span class="src-sym">}</span></li>
<li><a name="a1899"></a>            <span class="src-key">return </span><span class="src-var">$str</span><span class="src-sym">;</span></li>
<li><a name="a1900"></a>    <span class="src-sym">}</span></li>
<li><a name="a1901"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a1902"></a>    <span class="src-sym">}</span></li>
<li><a name="a1903"></a>&nbsp;</li>
<li><a name="a1904"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1905"></a><span class="src-doc">    * returns HTML form elements that allow a user</span></li>
<li><a name="a1906"></a><span class="src-doc">    * to enter values for creating an instance of the given type.</span></li>
<li><a name="a1907"></a><span class="src-doc">    *</span></li>
<li><a name="a1908"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">name for type instance</span></li>
<li><a name="a1909"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">name of type</span></li>
<li><a name="a1910"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span></li>
<li><a name="a1911"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1912"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a1913"></a><span class="src-doc">    */</span></li>
<li><a name="a1914"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodtypeToForm">typeToForm</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1915"></a>        <span class="src-comm">// get typedef</span></li>
<li><a name="a1916"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$typeDef </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a1917"></a>            <span class="src-comm">// if struct</span></li>
<li><a name="a1918"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>== <span class="src-str">'struct'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1919"></a>                <span class="src-var">$buffer </span>.= <span class="src-str">'&lt;table&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a1920"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$child </span>=&gt; <span class="src-var">$childDef</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1921"></a>                    <span class="src-var">$buffer </span>.= <span class="src-str">&quot;</span></li>
<li><a name="a1922"></a><span class="src-str">                    &lt;tr&gt;&lt;td align='right'&gt;<span class="src-var">$childDef</span><span class="src-sym">[</span><span class="src-id">name</span><span class="src-sym">]</span> (type: </span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$childDef</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;):&lt;/td&gt;</span></li>
<li><a name="a1923"></a><span class="src-str">                    &lt;td&gt;&lt;input type='text' name='parameters[&quot;</span>.<span class="src-var">$name</span>.<span class="src-str">&quot;</span><span class="src-str">][<span class="src-var">$childDef</span><span class="src-sym">[</span><span class="src-id">name</span><span class="src-sym">]</span>]'&gt;&lt;/td&gt;&lt;/tr&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1924"></a>                <span class="src-sym">}</span></li>
<li><a name="a1925"></a>                <span class="src-var">$buffer </span>.= <span class="src-str">'&lt;/table&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a1926"></a>            <span class="src-comm">// if array</span></li>
<li><a name="a1927"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1928"></a>                <span class="src-var">$buffer </span>.= <span class="src-str">'&lt;table&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a1929"></a>                <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>=<span class="src-num">0</span><span class="src-sym">;</span><span class="src-var">$i </span>&lt; <span class="src-num">3</span><span class="src-sym">; </span><span class="src-var">$i</span>++<span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1930"></a>                    <span class="src-var">$buffer </span>.= <span class="src-str">&quot;</span></li>
<li><a name="a1931"></a><span class="src-str">                    &lt;tr&gt;&lt;td align='right'&gt;array item (type: <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-id">arrayType</span><span class="src-sym">]</span>):&lt;/td&gt;</span></li>
<li><a name="a1932"></a><span class="src-str">                    &lt;td&gt;&lt;input type='text' name='parameters[</span><span class="src-str">&quot;</span>.<span class="src-var">$name</span>.<span class="src-str">&quot;][]'&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1933"></a>                <span class="src-sym">}</span></li>
<li><a name="a1934"></a>                <span class="src-var">$buffer </span>.= <span class="src-str">'&lt;/table&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a1935"></a>            <span class="src-comm">// if scalar</span></li>
<li><a name="a1936"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1937"></a>                <span class="src-var">$buffer </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;input type='text' name='parameters[<span class="src-var">$name</span>]'&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1938"></a>            <span class="src-sym">}</span></li>
<li><a name="a1939"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a1940"></a>            <span class="src-var">$buffer </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;input type='text' name='parameters[<span class="src-var">$name</span>]'&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a1941"></a>        <span class="src-sym">}</span></li>
<li><a name="a1942"></a>        <span class="src-key">return </span><span class="src-var">$buffer</span><span class="src-sym">;</span></li>
<li><a name="a1943"></a>    <span class="src-sym">}</span></li>
<li><a name="a1944"></a>    </li>
<li><a name="a1945"></a>    <span class="src-doc">/**</span></li>
<li><a name="a1946"></a><span class="src-doc">    * adds a complex type to the schema</span></li>
<li><a name="a1947"></a><span class="src-doc">    * </span></li>
<li><a name="a1948"></a><span class="src-doc">    * example: array</span></li>
<li><a name="a1949"></a><span class="src-doc">    * </span></li>
<li><a name="a1950"></a><span class="src-doc">    * addType(</span></li>
<li><a name="a1951"></a><span class="src-doc">    *     'ArrayOfstring',</span></li>
<li><a name="a1952"></a><span class="src-doc">    *     'complexType',</span></li>
<li><a name="a1953"></a><span class="src-doc">    *     'array',</span></li>
<li><a name="a1954"></a><span class="src-doc">    *     '',</span></li>
<li><a name="a1955"></a><span class="src-doc">    *     'SOAP-ENC:Array',</span></li>
<li><a name="a1956"></a><span class="src-doc">    *     array('ref'=&gt;'SOAP-ENC:arrayType','wsdl:arrayType'=&gt;'string[]'),</span></li>
<li><a name="a1957"></a><span class="src-doc">    *     'xsd:string'</span></li>
<li><a name="a1958"></a><span class="src-doc">    * );</span></li>
<li><a name="a1959"></a><span class="src-doc">    * </span></li>
<li><a name="a1960"></a><span class="src-doc">    * example: PHP associative array ( SOAP Struct )</span></li>
<li><a name="a1961"></a><span class="src-doc">    * </span></li>
<li><a name="a1962"></a><span class="src-doc">    * addType(</span></li>
<li><a name="a1963"></a><span class="src-doc">    *     'SOAPStruct',</span></li>
<li><a name="a1964"></a><span class="src-doc">    *     'complexType',</span></li>
<li><a name="a1965"></a><span class="src-doc">    *     'struct',</span></li>
<li><a name="a1966"></a><span class="src-doc">    *     'all',</span></li>
<li><a name="a1967"></a><span class="src-doc">    *     array('myVar'=&gt; array('name'=&gt;'myVar','type'=&gt;'string')</span></li>
<li><a name="a1968"></a><span class="src-doc">    * );</span></li>
<li><a name="a1969"></a><span class="src-doc">    * </span></li>
<li><a name="a1970"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">name </span></li>
<li><a name="a1971"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">typeClass </span><span class="src-doc">(complexType|simpleType|attribute)</span></li>
<li><a name="a1972"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">phpType: </span><span class="src-doc">currently supported are array and struct (php assoc array)</span></li>
<li><a name="a1973"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">compositor </span><span class="src-doc">(all|sequence|choice)</span></li>
<li><a name="a1974"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">restrictionBase </span><span class="src-doc">namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)</span></li>
<li><a name="a1975"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">elements </span><span class="src-doc">= array ( name = array(name=&gt;'',type=&gt;'') )</span></li>
<li><a name="a1976"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">attrs </span><span class="src-doc">= array(</span></li>
<li><a name="a1977"></a><span class="src-doc">    *      array(</span></li>
<li><a name="a1978"></a><span class="src-doc">    *         'ref' =&gt; &quot;http://schemas.xmlsoap.org/soap/encoding/:arrayType&quot;,</span></li>
<li><a name="a1979"></a><span class="src-doc">    *         &quot;http://schemas.xmlsoap.org/wsdl/:arrayType&quot; =&gt; &quot;string[]&quot;</span></li>
<li><a name="a1980"></a><span class="src-doc">    *      )</span></li>
<li><a name="a1981"></a><span class="src-doc">    *  )</span></li>
<li><a name="a1982"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">arrayType: </span><span class="src-doc">namespace:name (http://www.w3.org/2001/XMLSchema:string)</span></li>
<li><a name="a1983"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a1984"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> getTypeDef</span></li>
<li><a name="a1985"></a><span class="src-doc">    */</span></li>
<li><a name="a1986"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodaddComplexType">addComplexType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$typeClass</span>=<span class="src-str">'complexType'</span><span class="src-sym">,</span><span class="src-var">$phpType</span>=<span class="src-str">'array'</span><span class="src-sym">,</span><span class="src-var">$compositor</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$restrictionBase</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$elements</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$attrs</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$arrayType</span>=<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a1987"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a1988"></a>        <span class="src-str">'name'        </span>=&gt; <span class="src-var">$name</span><span class="src-sym">,</span></li>
<li><a name="a1989"></a>        <span class="src-str">'typeClass'    </span>=&gt; <span class="src-var">$typeClass</span><span class="src-sym">,</span></li>
<li><a name="a1990"></a>        <span class="src-str">'phpType'    </span>=&gt; <span class="src-var">$phpType</span><span class="src-sym">,</span></li>
<li><a name="a1991"></a>        <span class="src-str">'compositor'</span>=&gt; <span class="src-var">$compositor</span><span class="src-sym">,</span></li>
<li><a name="a1992"></a>        <span class="src-str">'restrictionBase' </span>=&gt; <span class="src-var">$restrictionBase</span><span class="src-sym">,</span></li>
<li><a name="a1993"></a>        <span class="src-str">'elements'    </span>=&gt; <span class="src-var">$elements</span><span class="src-sym">,</span></li>
<li><a name="a1994"></a>        <span class="src-str">'attrs'        </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">,</span></li>
<li><a name="a1995"></a>        <span class="src-str">'arrayType'    </span>=&gt; <span class="src-var">$arrayType</span></li>
<li><a name="a1996"></a>        <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1997"></a>        </li>
<li><a name="a1998"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">addComplexType <span class="src-var">$name</span>:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a1999"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$complexTypes">complexTypes</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2000"></a>    <span class="src-sym">}</span></li>
<li><a name="a2001"></a>    </li>
<li><a name="a2002"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2003"></a><span class="src-doc">    * adds a simple type to the schema</span></li>
<li><a name="a2004"></a><span class="src-doc">    *</span></li>
<li><a name="a2005"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span></li>
<li><a name="a2006"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$restrictionBase </span><span class="src-doc">namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)</span></li>
<li><a name="a2007"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$typeClass </span><span class="src-doc">(should always be simpleType)</span></li>
<li><a name="a2008"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$phpType </span><span class="src-doc">(should always be scalar)</span></li>
<li><a name="a2009"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$enumeration </span><span class="src-doc">array of values</span></li>
<li><a name="a2010"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a2011"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a2012"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> getTypeDef</span></li>
<li><a name="a2013"></a><span class="src-doc">    */</span></li>
<li><a name="a2014"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodaddSimpleType">addSimpleType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$restrictionBase</span>=<span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$typeClass</span>=<span class="src-str">'simpleType'</span><span class="src-sym">, </span><span class="src-var">$phpType</span>=<span class="src-str">'scalar'</span><span class="src-sym">, </span><span class="src-var">$enumeration</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2015"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a2016"></a>        <span class="src-str">'name'            </span>=&gt; <span class="src-var">$name</span><span class="src-sym">,</span></li>
<li><a name="a2017"></a>        <span class="src-str">'typeClass'        </span>=&gt; <span class="src-var">$typeClass</span><span class="src-sym">,</span></li>
<li><a name="a2018"></a>        <span class="src-str">'phpType'        </span>=&gt; <span class="src-var">$phpType</span><span class="src-sym">,</span></li>
<li><a name="a2019"></a>        <span class="src-str">'type'            </span>=&gt; <span class="src-var">$restrictionBase</span><span class="src-sym">,</span></li>
<li><a name="a2020"></a>        <span class="src-str">'enumeration'    </span>=&gt; <span class="src-var">$enumeration</span></li>
<li><a name="a2021"></a>        <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2022"></a>        </li>
<li><a name="a2023"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">addSimpleType <span class="src-var">$name</span>:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2024"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$simpleTypes">simpleTypes</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2025"></a>    <span class="src-sym">}</span></li>
<li><a name="a2026"></a>&nbsp;</li>
<li><a name="a2027"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2028"></a><span class="src-doc">    * adds an element to the schema</span></li>
<li><a name="a2029"></a><span class="src-doc">    *</span></li>
<li><a name="a2030"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$attrs </span><span class="src-doc">attributes that must include name and type</span></li>
<li><a name="a2031"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a2032"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a2033"></a><span class="src-doc">    */</span></li>
<li><a name="a2034"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_xmlschema.html#methodaddElement">addElement</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2035"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2036"></a>            <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$schemaTargetNamespace">schemaTargetNamespace</a> . <span class="src-str">':' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a2037"></a>        <span class="src-sym">}</span></li>
<li><a name="a2038"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a2039"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>= <span class="src-str">'element'</span><span class="src-sym">;</span></li>
<li><a name="a2040"></a>        </li>
<li><a name="a2041"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#methodxdebug">xdebug</a><span class="src-sym">(</span><span class="src-str">&quot;addElement &quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2042"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_xmlschema.html#var$elements">elements</a><span class="src-sym">[ </span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] ]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2043"></a>    <span class="src-sym">}</span></li>
<li><a name="a2044"></a><span class="src-sym">}</span></li>
<li><a name="a2045"></a>&nbsp;</li>
<li><a name="a2046"></a><span class="src-doc">/**</span></li>
<li><a name="a2047"></a><span class="src-doc"> * Backward compatibility</span></li>
<li><a name="a2048"></a><span class="src-doc"> */</span></li>
<li><a name="a2049"></a><span class="src-key">class </span><a href="../nusoap/XMLSchema.html">XMLSchema</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_xmlschema.html#methodnusoap_xmlschema">nusoap_xmlschema</a> <span class="src-sym">{</span></li>
<li><a name="a2050"></a><span class="src-sym">}</span></li>
<li><a name="a2051"></a>&nbsp;</li>
<li><a name="a2052"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a2053"></a>&nbsp;</li>
<li><a name="a2054"></a>&nbsp;</li>
<li><a name="a2055"></a>&nbsp;</li>
<li><a name="a2056"></a><span class="src-doc">/**</span></li>
<li><a name="a2057"></a><span class="src-doc">* For creating serializable abstractions of native PHP types.  This class</span></li>
<li><a name="a2058"></a><span class="src-doc">* allows element name/namespace, XSD type, and XML attributes to be</span></li>
<li><a name="a2059"></a><span class="src-doc">* associated with a value.  This is extremely useful when WSDL is not</span></li>
<li><a name="a2060"></a><span class="src-doc">* used, but is also useful when WSDL is used with polymorphic types, including</span></li>
<li><a name="a2061"></a><span class="src-doc">* xsd:anyType and user-defined types.</span></li>
<li><a name="a2062"></a><span class="src-doc">*</span></li>
<li><a name="a2063"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a2064"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a2065"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2066"></a><span class="src-doc">*/</span></li>
<li><a name="a2067"></a><span class="src-key">class </span><a href="../nusoap/soapval.html">soapval</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a2068"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2069"></a><span class="src-doc">     * The XML element name</span></li>
<li><a name="a2070"></a><span class="src-doc">     *</span></li>
<li><a name="a2071"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a2072"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2073"></a><span class="src-doc">     */</span></li>
<li><a name="a2074"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$name">$name</a><span class="src-sym">;</span></li>
<li><a name="a2075"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2076"></a><span class="src-doc">     * The XML type name (string or false)</span></li>
<li><a name="a2077"></a><span class="src-doc">     *</span></li>
<li><a name="a2078"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2079"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2080"></a><span class="src-doc">     */</span></li>
<li><a name="a2081"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$type">$type</a><span class="src-sym">;</span></li>
<li><a name="a2082"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2083"></a><span class="src-doc">     * The PHP value</span></li>
<li><a name="a2084"></a><span class="src-doc">     *</span></li>
<li><a name="a2085"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2086"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2087"></a><span class="src-doc">     */</span></li>
<li><a name="a2088"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$value">$value</a><span class="src-sym">;</span></li>
<li><a name="a2089"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2090"></a><span class="src-doc">     * The XML element namespace (string or false)</span></li>
<li><a name="a2091"></a><span class="src-doc">     *</span></li>
<li><a name="a2092"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2093"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2094"></a><span class="src-doc">     */</span></li>
<li><a name="a2095"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$element_ns">$element_ns</a><span class="src-sym">;</span></li>
<li><a name="a2096"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2097"></a><span class="src-doc">     * The XML type namespace (string or false)</span></li>
<li><a name="a2098"></a><span class="src-doc">     *</span></li>
<li><a name="a2099"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2100"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2101"></a><span class="src-doc">     */</span></li>
<li><a name="a2102"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$type_ns">$type_ns</a><span class="src-sym">;</span></li>
<li><a name="a2103"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2104"></a><span class="src-doc">     * The XML element attributes (array or false)</span></li>
<li><a name="a2105"></a><span class="src-doc">     *</span></li>
<li><a name="a2106"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2107"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2108"></a><span class="src-doc">     */</span></li>
<li><a name="a2109"></a>    <span class="src-key">var </span><a href="../nusoap/soapval.html#var$attributes">$attributes</a><span class="src-sym">;</span></li>
<li><a name="a2110"></a>&nbsp;</li>
<li><a name="a2111"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2112"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a2113"></a><span class="src-doc">    *</span></li>
<li><a name="a2114"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">optional name</span></li>
<li><a name="a2115"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$type </span><span class="src-doc">optional type name</span></li>
<li><a name="a2116"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">optional value</span></li>
<li><a name="a2117"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$element_ns </span><span class="src-doc">optional namespace of value</span></li>
<li><a name="a2118"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$type_ns </span><span class="src-doc">optional namespace of type</span></li>
<li><a name="a2119"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$attributes </span><span class="src-doc">associative array of attributes to add to element serialization</span></li>
<li><a name="a2120"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2121"></a><span class="src-doc">    */</span></li>
<li><a name="a2122"></a>      <span class="src-key">function </span><a href="../nusoap/soapval.html#methodsoapval">soapval</a><span class="src-sym">(</span><span class="src-var">$name</span>=<span class="src-str">'soapval'</span><span class="src-sym">,</span><span class="src-var">$type</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$value</span>=-<span class="src-num">1</span><span class="src-sym">,</span><span class="src-var">$element_ns</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$type_ns</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$attributes</span>=<span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2123"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2124"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$name">name</a> = <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a2125"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$type">type</a> = <span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a2126"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$value">value</a> = <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a2127"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$element_ns">element_ns</a> = <span class="src-var">$element_ns</span><span class="src-sym">;</span></li>
<li><a name="a2128"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$type_ns">type_ns</a> = <span class="src-var">$type_ns</span><span class="src-sym">;</span></li>
<li><a name="a2129"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$attributes">attributes</a> = <span class="src-var">$attributes</span><span class="src-sym">;</span></li>
<li><a name="a2130"></a>    <span class="src-sym">}</span></li>
<li><a name="a2131"></a>&nbsp;</li>
<li><a name="a2132"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2133"></a><span class="src-doc">    * return serialized value</span></li>
<li><a name="a2134"></a><span class="src-doc">    *</span></li>
<li><a name="a2135"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$use </span><span class="src-doc">The WSDL use value (encoded|literal)</span></li>
<li><a name="a2136"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">XML data</span></li>
<li><a name="a2137"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2138"></a><span class="src-doc">    */</span></li>
<li><a name="a2139"></a>    <span class="src-key">function </span><a href="../nusoap/soapval.html#methodserialize">serialize</a><span class="src-sym">(</span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2140"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$value">value</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$name">name</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$type">type</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$element_ns">element_ns</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$type_ns">type_ns</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$attributes">attributes</a><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2141"></a>    <span class="src-sym">}</span></li>
<li><a name="a2142"></a>&nbsp;</li>
<li><a name="a2143"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2144"></a><span class="src-doc">    * decodes a soapval object into a PHP native type</span></li>
<li><a name="a2145"></a><span class="src-doc">    *</span></li>
<li><a name="a2146"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span></li>
<li><a name="a2147"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2148"></a><span class="src-doc">    */</span></li>
<li><a name="a2149"></a>    <span class="src-key">function </span><a href="../nusoap/soapval.html#methoddecode">decode</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2150"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soapval.html#var$value">value</a><span class="src-sym">;</span></li>
<li><a name="a2151"></a>    <span class="src-sym">}</span></li>
<li><a name="a2152"></a><span class="src-sym">}</span></li>
<li><a name="a2153"></a>&nbsp;</li>
<li><a name="a2154"></a>&nbsp;</li>
<li><a name="a2155"></a>&nbsp;</li>
<li><a name="a2156"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a2157"></a>&nbsp;</li>
<li><a name="a2158"></a>&nbsp;</li>
<li><a name="a2159"></a>&nbsp;</li>
<li><a name="a2160"></a><span class="src-doc">/**</span></li>
<li><a name="a2161"></a><span class="src-doc">* transport class for sending/receiving data via HTTP and HTTPS</span></li>
<li><a name="a2162"></a><span class="src-doc">* NOTE: PHP must be compiled with the CURL extension for HTTPS support</span></li>
<li><a name="a2163"></a><span class="src-doc">*</span></li>
<li><a name="a2164"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a2165"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a2166"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a2167"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a2168"></a><span class="src-doc">*/</span></li>
<li><a name="a2169"></a><span class="src-key">class </span><a href="../nusoap/soap_transport_http.html">soap_transport_http</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a2170"></a>&nbsp;</li>
<li><a name="a2171"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$url">$url</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2172"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$uri">$uri</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2173"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$digest_uri">$digest_uri</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2174"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$scheme">$scheme</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2175"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$host">$host</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2176"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$port">$port</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2177"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$path">$path</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2178"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$request_method">$request_method</a> = <span class="src-str">'POST'</span><span class="src-sym">;</span></li>
<li><a name="a2179"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$protocol_version">$protocol_version</a> = <span class="src-str">'1.0'</span><span class="src-sym">;</span></li>
<li><a name="a2180"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$encoding">$encoding</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2181"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">$outgoing_headers</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2182"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">$incoming_headers</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2183"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$incoming_cookies">$incoming_cookies</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2184"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">$outgoing_payload</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2185"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">$incoming_payload</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2186"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$response_status_line">$response_status_line</a><span class="src-sym">;    </span><span class="src-comm">// HTTP response status line</span></li>
<li><a name="a2186"></a>    </li>
<li><a name="a2187"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$useSOAPAction">$useSOAPAction</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2188"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">$persistentConnection</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2189"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$ch">$ch</a> = <span class="src-id">false</span><span class="src-sym">;    </span><span class="src-comm">// cURL handle</span></li>
<li><a name="a2189"></a>    </li>
<li><a name="a2190"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$ch_options">$ch_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// cURL custom options</span></li>
<li><a name="a2190"></a>    </li>
<li><a name="a2191"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$use_curl">$use_curl</a> = <span class="src-id">false</span><span class="src-sym">;        </span><span class="src-comm">// force cURL use</span></li>
<li><a name="a2191"></a>    </li>
<li><a name="a2192"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$proxy">$proxy</a> = <span class="src-id">null</span><span class="src-sym">;            </span><span class="src-comm">// proxy information (associative array)</span></li>
<li><a name="a2192"></a>    </li>
<li><a name="a2193"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$username">$username</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2194"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$password">$password</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2195"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$authtype">$authtype</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2196"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$digestRequest">$digestRequest</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2197"></a>    <span class="src-key">var </span><a href="../nusoap/soap_transport_http.html#var$certRequest">$certRequest</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional)</span></li>
<li><a name="a2198"></a>                                <span class="src-comm">// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'</span></li>
<li><a name="a2199"></a>                                <span class="src-comm">// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'</span></li>
<li><a name="a2200"></a>                                <span class="src-comm">// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'</span></li>
<li><a name="a2201"></a>                                <span class="src-comm">// passphrase: SSL key password/passphrase</span></li>
<li><a name="a2202"></a>                                <span class="src-comm">// certpassword: SSL certificate password</span></li>
<li><a name="a2203"></a>                                <span class="src-comm">// verifypeer: default is 1</span></li>
<li><a name="a2204"></a>                                <span class="src-comm">// verifyhost: default is 1</span></li>
<li><a name="a2205"></a>&nbsp;</li>
<li><a name="a2204"></a>    </li>
<li><a name="a2205"></a>&nbsp;</li>
<li><a name="a2206"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2207"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a2208"></a><span class="src-doc">    *</span></li>
<li><a name="a2209"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$url </span><span class="src-doc">The URL to which to connect</span></li>
<li><a name="a2210"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$curl_options </span><span class="src-doc">User-specified cURL options</span></li>
<li><a name="a2211"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$use_curl </span><span class="src-doc">Whether to try to force cURL use</span></li>
<li><a name="a2212"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a2213"></a><span class="src-doc">    */</span></li>
<li><a name="a2214"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsoap_transport_http">soap_transport_http</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$curl_options </span>= <span class="src-id">NULL</span><span class="src-sym">, </span><span class="src-var">$use_curl </span>= <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2215"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2216"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">ctor url=<span class="src-var">$url</span> use_curl=<span class="src-var">$use_curl</span> curl_options:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2217"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$curl_options</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2218"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetURL">setURL</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2219"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$curl_options</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2220"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch_options">ch_options</a> = <span class="src-var">$curl_options</span><span class="src-sym">;</span></li>
<li><a name="a2221"></a>        <span class="src-sym">}</span></li>
<li><a name="a2222"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$use_curl">use_curl</a> = <span class="src-var">$use_curl</span><span class="src-sym">;</span></li>
<li><a name="a2223"></a>        <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/\$Revisio' </span>. <span class="src-str">'n: ([^ ]+)/'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$revision">revision</a><span class="src-sym">, </span><span class="src-var">$rev</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2224"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'User-Agent'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$title">title</a>.<span class="src-str">'/'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$version">version</a>.<span class="src-str">' ('</span>.<span class="src-var">$rev</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>.<span class="src-str">')'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2225"></a>    <span class="src-sym">}</span></li>
<li><a name="a2226"></a>&nbsp;</li>
<li><a name="a2227"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2228"></a><span class="src-doc">    * sets a cURL option</span></li>
<li><a name="a2229"></a><span class="src-doc">    *</span></li>
<li><a name="a2230"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$option </span><span class="src-doc">The cURL option (always integer?)</span></li>
<li><a name="a2231"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">The cURL option value</span></li>
<li><a name="a2232"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a2233"></a><span class="src-doc">    */</span></li>
<li><a name="a2234"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$option</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2235"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setCurlOption option=<span class="src-var">$option</span>, value=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2236"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2237"></a>        <a href="http://www.php.net/curl_setopt">curl_setopt</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">, </span><span class="src-var">$option</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2238"></a>    <span class="src-sym">}</span></li>
<li><a name="a2239"></a>&nbsp;</li>
<li><a name="a2240"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2241"></a><span class="src-doc">    * sets an HTTP header</span></li>
<li><a name="a2242"></a><span class="src-doc">    *</span></li>
<li><a name="a2243"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">The name of the header</span></li>
<li><a name="a2244"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$value </span><span class="src-doc">The value of the header</span></li>
<li><a name="a2245"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2246"></a><span class="src-doc">    */</span></li>
<li><a name="a2247"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2248"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a2249"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">set header <span class="src-var">$name</span>: <span class="src-var">$value</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2250"></a>    <span class="src-sym">}</span></li>
<li><a name="a2251"></a>&nbsp;</li>
<li><a name="a2252"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2253"></a><span class="src-doc">    * unsets an HTTP header</span></li>
<li><a name="a2254"></a><span class="src-doc">    *</span></li>
<li><a name="a2255"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">The name of the header</span></li>
<li><a name="a2256"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2257"></a><span class="src-doc">    */</span></li>
<li><a name="a2258"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodunsetHeader">unsetHeader</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2259"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2260"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">unset header <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2261"></a>            unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2262"></a>        <span class="src-sym">}</span></li>
<li><a name="a2263"></a>    <span class="src-sym">}</span></li>
<li><a name="a2264"></a>&nbsp;</li>
<li><a name="a2265"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2266"></a><span class="src-doc">    * sets the URL to which to connect</span></li>
<li><a name="a2267"></a><span class="src-doc">    *</span></li>
<li><a name="a2268"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$url </span><span class="src-doc">The URL to which to connect</span></li>
<li><a name="a2269"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a2270"></a><span class="src-doc">    */</span></li>
<li><a name="a2271"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetURL">setURL</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2272"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$url">url</a> = <span class="src-var">$url</span><span class="src-sym">;</span></li>
<li><a name="a2273"></a>&nbsp;</li>
<li><a name="a2274"></a>        <span class="src-var">$u </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2275"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$u </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2276"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">parsed URL <span class="src-var">$k</span> = <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2277"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">$k </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a2278"></a>        <span class="src-sym">}</span></li>
<li><a name="a2279"></a>        </li>
<li><a name="a2280"></a>        <span class="src-comm">// add any GET params to path</span></li>
<li><a name="a2281"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'query'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'query'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2282"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$path">path</a> .= <span class="src-str">'?' </span>. <span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'query'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a2283"></a>        <span class="src-sym">}</span></li>
<li><a name="a2284"></a>        </li>
<li><a name="a2285"></a>        <span class="src-comm">// set default port</span></li>
<li><a name="a2286"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a2287"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>== <span class="src-str">'https'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2288"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a> = <span class="src-num">443</span><span class="src-sym">;</span></li>
<li><a name="a2289"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2290"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a> = <span class="src-num">80</span><span class="src-sym">;</span></li>
<li><a name="a2291"></a>            <span class="src-sym">}</span></li>
<li><a name="a2292"></a>        <span class="src-sym">}</span></li>
<li><a name="a2293"></a>        </li>
<li><a name="a2294"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$uri">uri</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$path">path</a><span class="src-sym">;</span></li>
<li><a name="a2295"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$digest_uri">digest_uri</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$uri">uri</a><span class="src-sym">;</span></li>
<li><a name="a2296"></a>        </li>
<li><a name="a2297"></a>        <span class="src-comm">// build headers</span></li>
<li><a name="a2298"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2299"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Host'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2300"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2301"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Host'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a>.<span class="src-str">':'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2302"></a>        <span class="src-sym">}</span></li>
<li><a name="a2303"></a>&nbsp;</li>
<li><a name="a2304"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'user'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'user'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2305"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCredentials">setCredentials</a><span class="src-sym">(</span><a href="http://www.php.net/urldecode">urldecode</a><span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'user'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'pass'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <a href="http://www.php.net/urldecode">urldecode</a><span class="src-sym">(</span><span class="src-var">$u</span><span class="src-sym">[</span><span class="src-str">'pass'</span><span class="src-sym">]</span><span class="src-sym">) </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2306"></a>        <span class="src-sym">}</span></li>
<li><a name="a2307"></a>    <span class="src-sym">}</span></li>
<li><a name="a2308"></a>&nbsp;</li>
<li><a name="a2309"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2310"></a><span class="src-doc">    * gets the I/O method to use</span></li>
<li><a name="a2311"></a><span class="src-doc">    *</span></li>
<li><a name="a2312"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   I/O method to use (socket|curl|unknown)</span></li>
<li><a name="a2313"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a2314"></a><span class="src-doc">    */</span></li>
<li><a name="a2315"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2316"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$use_curl">use_curl</a> || <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'https'</span><span class="src-sym">) </span>|| <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'http' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> == <span class="src-str">'ntlm'</span><span class="src-sym">) </span>|| <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'http' </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'authtype'</span><span class="src-sym">] </span>== <span class="src-str">'ntlm'</span><span class="src-sym">))</span></li>
<li><a name="a2317"></a>            <span class="src-key">return </span><span class="src-str">'curl'</span><span class="src-sym">;</span></li>
<li><a name="a2318"></a>        <span class="src-key">if </span><span class="src-sym">((</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'http' </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'ssl'</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> != <span class="src-str">'ntlm' </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">) </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'authtype'</span><span class="src-sym">] </span>!= <span class="src-str">'ntlm'</span><span class="src-sym">))</span></li>
<li><a name="a2319"></a>            <span class="src-key">return </span><span class="src-str">'socket'</span><span class="src-sym">;</span></li>
<li><a name="a2320"></a>        <span class="src-key">return </span><span class="src-str">'unknown'</span><span class="src-sym">;</span></li>
<li><a name="a2321"></a>    <span class="src-sym">}</span></li>
<li><a name="a2322"></a>&nbsp;</li>
<li><a name="a2323"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2324"></a><span class="src-doc">    * establish an HTTP connection</span></li>
<li><a name="a2325"></a><span class="src-doc">    *</span></li>
<li><a name="a2326"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set connection timeout in seconds</span></li>
<li><a name="a2327"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set response timeout in seconds</span></li>
<li><a name="a2328"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">true if connected, false if not</span></li>
<li><a name="a2329"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a2330"></a><span class="src-doc">    */</span></li>
<li><a name="a2331"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodconnect">connect</a><span class="src-sym">(</span><span class="src-var">$connection_timeout</span>=<span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$response_timeout</span>=<span class="src-num">30</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2332"></a>          <span class="src-comm">// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like</span></li>
<li><a name="a2333"></a>          <span class="src-comm">// &quot;regular&quot; socket.</span></li>
<li><a name="a2334"></a>          <span class="src-comm">// TODO: disabled for now because OpenSSL must be *compiled* in (not just</span></li>
<li><a name="a2335"></a>          <span class="src-comm">//       loaded), and until PHP5 stream_get_wrappers is not available.</span></li>
<li><a name="a2336"></a><span class="src-comm">//          if ($this-&gt;scheme == 'https') {</span></li>
<li><a name="a2337"></a><span class="src-comm">//              if (version_compare(phpversion(), '4.3.0') &gt;= 0) {</span></li>
<li><a name="a2338"></a><span class="src-comm">//                  if (extension_loaded('openssl')) {</span></li>
<li><a name="a2339"></a><span class="src-comm">//                      $this-&gt;scheme = 'ssl';</span></li>
<li><a name="a2340"></a><span class="src-comm">//                      $this-&gt;debug('Using SSL over OpenSSL');</span></li>
<li><a name="a2341"></a><span class="src-comm">//                  }</span></li>
<li><a name="a2342"></a><span class="src-comm">//              }</span></li>
<li><a name="a2343"></a><span class="src-comm">//        }</span></li>
<li><a name="a2344"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">connect connection_timeout <span class="src-var">$connection_timeout</span>, response_timeout <span class="src-var">$response_timeout</span>, scheme <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a>, host <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a>, port <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2345"></a>      <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'socket'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2346"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2347"></a>            <span class="src-var">$host </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a><span class="src-sym">;</span></li>
<li><a name="a2348"></a>            <span class="src-var">$port </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-sym">;</span></li>
<li><a name="a2349"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2350"></a>            <span class="src-var">$host </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a2351"></a>            <span class="src-var">$port </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a2352"></a>        <span class="src-sym">}</span></li>
<li><a name="a2353"></a>&nbsp;</li>
<li><a name="a2354"></a>        <span class="src-comm">// use persistent connection</span></li>
<li><a name="a2355"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a> &amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_resource">is_resource</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a2356"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2357"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Re-use persistent connection'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2358"></a>                <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2359"></a>            <span class="src-sym">}</span></li>
<li><a name="a2360"></a>            <a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2361"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Closed persistent connection at EOF'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2362"></a>        <span class="src-sym">}</span></li>
<li><a name="a2363"></a>&nbsp;</li>
<li><a name="a2364"></a>        <span class="src-comm">// munge host if using OpenSSL</span></li>
<li><a name="a2365"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'ssl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2366"></a>            <span class="src-var">$host </span>= <span class="src-str">'ssl://' </span>. <span class="src-var">$host</span><span class="src-sym">;</span></li>
<li><a name="a2367"></a>        <span class="src-sym">}</span></li>
<li><a name="a2368"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling fsockopen with host ' </span>. <span class="src-var">$host </span>. <span class="src-str">' connection_timeout ' </span>. <span class="src-var">$connection_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2369"></a>&nbsp;</li>
<li><a name="a2370"></a>        <span class="src-comm">// open socket</span></li>
<li><a name="a2371"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$connection_timeout </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2372"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp </span>= <span class="src-sym">@</span><a href="http://www.php.net/fsockopen">fsockopen</a><span class="src-sym">( </span><span class="src-var">$host</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a><span class="src-sym">, </span><span class="src-var">$connection_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2373"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2374"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp </span>= <span class="src-sym">@</span><a href="http://www.php.net/fsockopen">fsockopen</a><span class="src-sym">( </span><span class="src-var">$host</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2375"></a>        <span class="src-sym">}</span></li>
<li><a name="a2376"></a>        </li>
<li><a name="a2377"></a>        <span class="src-comm">// test pointer</span></li>
<li><a name="a2378"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2379"></a>            <span class="src-var">$msg </span>= <span class="src-str">'Couldn\'t open socket connection to server ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$url">url</a><span class="src-sym">;</span></li>
<li><a name="a2380"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2381"></a>                <span class="src-var">$msg </span>.= <span class="src-str">', Error ('</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span>.<span class="src-str">'): '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$error_str">error_str</a><span class="src-sym">;</span></li>
<li><a name="a2382"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2383"></a>                <span class="src-var">$msg </span>.= <span class="src-str">' prior to connect().  This is often a problem looking up the host name.'</span><span class="src-sym">;</span></li>
<li><a name="a2384"></a>            <span class="src-sym">}</span></li>
<li><a name="a2385"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2386"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2387"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2388"></a>        <span class="src-sym">}</span></li>
<li><a name="a2389"></a>        </li>
<li><a name="a2390"></a>        <span class="src-comm">// set response timeout</span></li>
<li><a name="a2391"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set response timeout to ' </span>. <span class="src-var">$response_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2392"></a>        <a href="http://www.php.net/socket_set_timeout">socket_set_timeout</a><span class="src-sym">( </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2393"></a>&nbsp;</li>
<li><a name="a2394"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'socket connected'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2395"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2396"></a>      <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'curl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2397"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/extension_loaded">extension_loaded</a><span class="src-sym">(</span><span class="src-str">'curl'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2398"></a><span class="src-comm">//            $this-&gt;setError('cURL Extension, or OpenSSL extension w/ PHP version &gt;= 4.3 is required for HTTPS');</span></li>
<li><a name="a2399"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'The PHP cURL Extension is required for HTTPS or NLTM.  You will need to re-build or update your PHP to include cURL or change php.ini to load the PHP cURL extension.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2400"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2401"></a>        <span class="src-sym">}</span></li>
<li><a name="a2402"></a>        <span class="src-comm">// Avoid warnings when PHP does not have these options</span></li>
<li><a name="a2403"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLOPT_CONNECTIONTIMEOUT'</span><span class="src-sym">))</span></li>
<li><a name="a2404"></a>            <span class="src-var">$CURLOPT_CONNECTIONTIMEOUT </span>= <span class="src-id">CURLOPT_CONNECTIONTIMEOUT</span><span class="src-sym">;</span></li>
<li><a name="a2405"></a>        <span class="src-key">else</span></li>
<li><a name="a2406"></a>            <span class="src-var">$CURLOPT_CONNECTIONTIMEOUT </span>= <span class="src-num">78</span><span class="src-sym">;</span></li>
<li><a name="a2407"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLOPT_HTTPAUTH'</span><span class="src-sym">))</span></li>
<li><a name="a2408"></a>            <span class="src-var">$CURLOPT_HTTPAUTH </span>= <span class="src-id">CURLOPT_HTTPAUTH</span><span class="src-sym">;</span></li>
<li><a name="a2409"></a>        <span class="src-key">else</span></li>
<li><a name="a2410"></a>            <span class="src-var">$CURLOPT_HTTPAUTH </span>= <span class="src-num">107</span><span class="src-sym">;</span></li>
<li><a name="a2411"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLOPT_PROXYAUTH'</span><span class="src-sym">))</span></li>
<li><a name="a2412"></a>            <span class="src-var">$CURLOPT_PROXYAUTH </span>= <span class="src-id">CURLOPT_PROXYAUTH</span><span class="src-sym">;</span></li>
<li><a name="a2413"></a>        <span class="src-key">else</span></li>
<li><a name="a2414"></a>            <span class="src-var">$CURLOPT_PROXYAUTH </span>= <span class="src-num">111</span><span class="src-sym">;</span></li>
<li><a name="a2415"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLAUTH_BASIC'</span><span class="src-sym">))</span></li>
<li><a name="a2416"></a>            <span class="src-var">$CURLAUTH_BASIC </span>= <span class="src-id">CURLAUTH_BASIC</span><span class="src-sym">;</span></li>
<li><a name="a2417"></a>        <span class="src-key">else</span></li>
<li><a name="a2418"></a>            <span class="src-var">$CURLAUTH_BASIC </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a2419"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLAUTH_DIGEST'</span><span class="src-sym">))</span></li>
<li><a name="a2420"></a>            <span class="src-var">$CURLAUTH_DIGEST </span>= <span class="src-id">CURLAUTH_DIGEST</span><span class="src-sym">;</span></li>
<li><a name="a2421"></a>        <span class="src-key">else</span></li>
<li><a name="a2422"></a>            <span class="src-var">$CURLAUTH_DIGEST </span>= <span class="src-num">2</span><span class="src-sym">;</span></li>
<li><a name="a2423"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'CURLAUTH_NTLM'</span><span class="src-sym">))</span></li>
<li><a name="a2424"></a>            <span class="src-var">$CURLAUTH_NTLM </span>= <span class="src-id">CURLAUTH_NTLM</span><span class="src-sym">;</span></li>
<li><a name="a2425"></a>        <span class="src-key">else</span></li>
<li><a name="a2426"></a>            <span class="src-var">$CURLAUTH_NTLM </span>= <span class="src-num">8</span><span class="src-sym">;</span></li>
<li><a name="a2427"></a>&nbsp;</li>
<li><a name="a2428"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'connect using cURL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2429"></a>        <span class="src-comm">// init CURL</span></li>
<li><a name="a2430"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a> = <a href="http://www.php.net/curl_init">curl_init</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2431"></a>        <span class="src-comm">// set url</span></li>
<li><a name="a2432"></a>        <span class="src-var">$hostURL </span>= <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a> != <span class="src-str">''</span><span class="src-sym">) </span>? <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a>://<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a>:<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$port">port</a><span class="src-str">"</span> </span>: <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a>://<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a><span class="src-str">"</span></span><span class="src-sym">;</span></li>
<li><a name="a2433"></a>        <span class="src-comm">// add path</span></li>
<li><a name="a2434"></a>        <span class="src-var">$hostURL </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$path">path</a><span class="src-sym">;</span></li>
<li><a name="a2435"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_URL</span><span class="src-sym">, </span><span class="src-var">$hostURL</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2436"></a>        <span class="src-comm">// follow location headers (re-directs)</span></li>
<li><a name="a2437"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">'safe_mode'</span><span class="src-sym">) </span>|| <a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">'open_basedir'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2438"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'safe_mode or open_basedir set, so do not set CURLOPT_FOLLOWLOCATION'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2439"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'safe_mode = '</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2440"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">'safe_mode'</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a2441"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'open_basedir = '</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2442"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">'open_basedir'</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a2443"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2444"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_FOLLOWLOCATION</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2445"></a>        <span class="src-sym">}</span></li>
<li><a name="a2446"></a>        <span class="src-comm">// ask for headers in the response output</span></li>
<li><a name="a2447"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_HEADER</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2448"></a>        <span class="src-comm">// ask for the response output as the return value</span></li>
<li><a name="a2449"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_RETURNTRANSFER</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2450"></a>        <span class="src-comm">// encode</span></li>
<li><a name="a2451"></a>        <span class="src-comm">// We manage this ourselves through headers and encoding</span></li>
<li><a name="a2452"></a><span class="src-comm">//        if(function_exists('gzuncompress')){</span></li>
<li><a name="a2453"></a><span class="src-comm">//            $this-&gt;setCurlOption(CURLOPT_ENCODING, 'deflate');</span></li>
<li><a name="a2454"></a><span class="src-comm">//        }</span></li>
<li><a name="a2455"></a>        <span class="src-comm">// persistent connection</span></li>
<li><a name="a2456"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2457"></a>            <span class="src-comm">// I believe the following comment is now bogus, having applied to</span></li>
<li><a name="a2458"></a>            <span class="src-comm">// the code when it used CURLOPT_CUSTOMREQUEST to send the request.</span></li>
<li><a name="a2459"></a>            <span class="src-comm">// The way we send data, we cannot use persistent connections, since</span></li>
<li><a name="a2460"></a>            <span class="src-comm">// there will be some &quot;junk&quot; at the end of our request.</span></li>
<li><a name="a2461"></a>            <span class="src-comm">//$this-&gt;setCurlOption(CURL_HTTP_VERSION_1_1, true);</span></li>
<li><a name="a2462"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2463"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Connection'</span><span class="src-sym">, </span><span class="src-str">'close'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2464"></a>        <span class="src-sym">}</span></li>
<li><a name="a2465"></a>        <span class="src-comm">// set timeouts</span></li>
<li><a name="a2466"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$connection_timeout </span>!= <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2467"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_CONNECTIONTIMEOUT</span><span class="src-sym">, </span><span class="src-var">$connection_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2468"></a>        <span class="src-sym">}</span></li>
<li><a name="a2469"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$response_timeout </span>!= <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2470"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_TIMEOUT</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2471"></a>        <span class="src-sym">}</span></li>
<li><a name="a2472"></a>&nbsp;</li>
<li><a name="a2473"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'https'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2474"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL SSL verify options'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2475"></a>            <span class="src-comm">// recent versions of cURL turn on peer/host checking by default,</span></li>
<li><a name="a2476"></a>            <span class="src-comm">// while PHP binaries are not compiled with a default location for the</span></li>
<li><a name="a2477"></a>            <span class="src-comm">// CA cert bundle, so disable peer/host checking.</span></li>
<li><a name="a2478"></a>            <span class="src-comm">//$this-&gt;setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');        </span></li>
<li><a name="a2479"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYPEER</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2480"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYHOST</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2481"></a>    </li>
<li><a name="a2482"></a>            <span class="src-comm">// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)</span></li>
<li><a name="a2483"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> == <span class="src-str">'certificate'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2484"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL certificate options'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2485"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'cainfofile'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2486"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_CAINFO</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'cainfofile'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2487"></a>                <span class="src-sym">}</span></li>
<li><a name="a2488"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'verifypeer'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2489"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYPEER</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'verifypeer'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2490"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2491"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYPEER</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2492"></a>                <span class="src-sym">}</span></li>
<li><a name="a2493"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'verifyhost'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2494"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYHOST</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'verifyhost'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2495"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2496"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSL_VERIFYHOST</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2497"></a>                <span class="src-sym">}</span></li>
<li><a name="a2498"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'sslcertfile'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2499"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSLCERT</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'sslcertfile'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2500"></a>                <span class="src-sym">}</span></li>
<li><a name="a2501"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'sslkeyfile'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2502"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSLKEY</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'sslkeyfile'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2503"></a>                <span class="src-sym">}</span></li>
<li><a name="a2504"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'passphrase'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2505"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSLKEYPASSWD</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'passphrase'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2506"></a>                <span class="src-sym">}</span></li>
<li><a name="a2507"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'certpassword'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2508"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_SSLCERTPASSWD</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a><span class="src-sym">[</span><span class="src-str">'certpassword'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2509"></a>                <span class="src-sym">}</span></li>
<li><a name="a2510"></a>            <span class="src-sym">}</span></li>
<li><a name="a2511"></a>        <span class="src-sym">}</span></li>
<li><a name="a2512"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> &amp;&amp; <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> != <span class="src-str">'certificate'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2513"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$username">username</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2514"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL username/password'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2515"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_USERPWD</span><span class="src-sym">, </span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$username">username</a>:<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$password">password</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2516"></a>            <span class="src-sym">}</span></li>
<li><a name="a2517"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> == <span class="src-str">'basic'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2518"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL for Basic authentication'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2519"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_HTTPAUTH</span><span class="src-sym">, </span><span class="src-var">$CURLAUTH_BASIC</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2520"></a>            <span class="src-sym">}</span></li>
<li><a name="a2521"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> == <span class="src-str">'digest'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2522"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL for digest authentication'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2523"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_HTTPAUTH</span><span class="src-sym">, </span><span class="src-var">$CURLAUTH_DIGEST</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2524"></a>            <span class="src-sym">}</span></li>
<li><a name="a2525"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> == <span class="src-str">'ntlm'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2526"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL for NTLM authentication'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2527"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_HTTPAUTH</span><span class="src-sym">, </span><span class="src-var">$CURLAUTH_NTLM</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2528"></a>            <span class="src-sym">}</span></li>
<li><a name="a2529"></a>        <span class="src-sym">}</span></li>
<li><a name="a2530"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2531"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL proxy options'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2532"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2533"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_PROXY</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span>.<span class="src-str">':'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2534"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2535"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_PROXY</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2536"></a>            <span class="src-sym">}</span></li>
<li><a name="a2537"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">] </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'password'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2538"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL proxy authentication options'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2539"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_PROXYUSERPWD</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">]</span>.<span class="src-str">':'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'password'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2540"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'authtype'</span><span class="src-sym">] </span>== <span class="src-str">'basic'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2541"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_PROXYAUTH</span><span class="src-sym">, </span><span class="src-var">$CURLAUTH_BASIC</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2542"></a>                <span class="src-sym">}</span></li>
<li><a name="a2543"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">[</span><span class="src-str">'authtype'</span><span class="src-sym">] </span>== <span class="src-str">'ntlm'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2544"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$CURLOPT_PROXYAUTH</span><span class="src-sym">, </span><span class="src-var">$CURLAUTH_NTLM</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2545"></a>                <span class="src-sym">}</span></li>
<li><a name="a2546"></a>            <span class="src-sym">}</span></li>
<li><a name="a2547"></a>        <span class="src-sym">}</span></li>
<li><a name="a2548"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cURL connection set up'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2549"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2550"></a>      <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2551"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Unknown scheme ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2552"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Unknown scheme ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2553"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2554"></a>      <span class="src-sym">}</span></li>
<li><a name="a2555"></a>    <span class="src-sym">}</span></li>
<li><a name="a2556"></a>&nbsp;</li>
<li><a name="a2557"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2558"></a><span class="src-doc">    * sends the SOAP request and gets the SOAP response via HTTP[S]</span></li>
<li><a name="a2559"></a><span class="src-doc">    *</span></li>
<li><a name="a2560"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">message data</span></li>
<li><a name="a2561"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set connection timeout in seconds</span></li>
<li><a name="a2562"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set response timeout in seconds</span></li>
<li><a name="a2563"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$cookies </span><span class="src-doc">cookies to send</span></li>
<li><a name="a2564"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">data</span></li>
<li><a name="a2565"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2566"></a><span class="src-doc">    */</span></li>
<li><a name="a2567"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsend">send</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$timeout</span>=<span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span>=<span class="src-num">30</span><span class="src-sym">, </span><span class="src-var">$cookies</span>=<span class="src-id">NULL</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2568"></a>        </li>
<li><a name="a2569"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'entered send() with data of length: '</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2570"></a>&nbsp;</li>
<li><a name="a2571"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tryagain </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2572"></a>        <span class="src-var">$tries </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a2573"></a>        <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tryagain</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2574"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tryagain </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2575"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tries</span>++ &lt; <span class="src-num">2</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2576"></a>                <span class="src-comm">// make connnection</span></li>
<li><a name="a2577"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodconnect">connect</a><span class="src-sym">(</span><span class="src-var">$timeout</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a2578"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2579"></a>                <span class="src-sym">}</span></li>
<li><a name="a2580"></a>                </li>
<li><a name="a2581"></a>                <span class="src-comm">// send request</span></li>
<li><a name="a2582"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsendRequest">sendRequest</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$cookies</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a2583"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2584"></a>                <span class="src-sym">}</span></li>
<li><a name="a2585"></a>                </li>
<li><a name="a2586"></a>                <span class="src-comm">// get response</span></li>
<li><a name="a2587"></a>                <span class="src-var">$respdata </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodgetResponse">getResponse</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2588"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2589"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Too many tries to get an OK response (<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$response_status_line">response_status_line</a>)</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2590"></a>            <span class="src-sym">}</span></li>
<li><a name="a2591"></a>        <span class="src-sym">}        </span></li>
<li><a name="a2592"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'end of send()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2593"></a>        <span class="src-key">return </span><span class="src-var">$respdata</span><span class="src-sym">;</span></li>
<li><a name="a2594"></a>    <span class="src-sym">}</span></li>
<li><a name="a2595"></a>&nbsp;</li>
<li><a name="a2596"></a>&nbsp;</li>
<li><a name="a2597"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2598"></a><span class="src-doc">    * sends the SOAP request and gets the SOAP response via HTTPS using CURL</span></li>
<li><a name="a2599"></a><span class="src-doc">    *</span></li>
<li><a name="a2600"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">message data</span></li>
<li><a name="a2601"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set connection timeout in seconds</span></li>
<li><a name="a2602"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set response timeout in seconds</span></li>
<li><a name="a2603"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$cookies </span><span class="src-doc">cookies to send</span></li>
<li><a name="a2604"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">data</span></li>
<li><a name="a2605"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2606"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a2607"></a><span class="src-doc">    */</span></li>
<li><a name="a2608"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsendHTTPS">sendHTTPS</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$timeout</span>=<span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span>=<span class="src-num">30</span><span class="src-sym">, </span><span class="src-var">$cookies</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2609"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsend">send</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$timeout</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span><span class="src-sym">, </span><span class="src-var">$cookies</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2610"></a>    <span class="src-sym">}</span></li>
<li><a name="a2611"></a>    </li>
<li><a name="a2612"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2613"></a><span class="src-doc">    * if authenticating, set user credentials here</span></li>
<li><a name="a2614"></a><span class="src-doc">    *</span></li>
<li><a name="a2615"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$username </span></li>
<li><a name="a2616"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$password </span></li>
<li><a name="a2617"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$authtype </span><span class="src-doc">(basic|digest|certificate|ntlm)</span></li>
<li><a name="a2618"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$digestRequest </span><span class="src-doc">(keys must be nonce, nc, realm, qop)</span></li>
<li><a name="a2619"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$certRequest </span><span class="src-doc">(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)</span></li>
<li><a name="a2620"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2621"></a><span class="src-doc">    */</span></li>
<li><a name="a2622"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetCredentials">setCredentials</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">, </span><span class="src-var">$password</span><span class="src-sym">, </span><span class="src-var">$authtype </span>= <span class="src-str">'basic'</span><span class="src-sym">, </span><span class="src-var">$digestRequest </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$certRequest </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2623"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setCredentials username=<span class="src-var">$username</span> authtype=<span class="src-var">$authtype</span> digestRequest=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2624"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2625"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;certRequest=&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2626"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$certRequest</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2627"></a>        <span class="src-comm">// cf. RFC 2617</span></li>
<li><a name="a2628"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$authtype </span>== <span class="src-str">'basic'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2629"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Authorization'</span><span class="src-sym">, </span><span class="src-str">'Basic '</span>.<a href="http://www.php.net/base64_encode">base64_encode</a><span class="src-sym">(</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$username</span><span class="src-sym">)</span>.<span class="src-str">':'</span>.<span class="src-var">$password</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2630"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$authtype </span>== <span class="src-str">'digest'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2631"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nonce'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2632"></a>                <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nc'</span><span class="src-sym">] </span>= isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nc'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nc'</span><span class="src-sym">]</span>++ : <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a2633"></a>                </li>
<li><a name="a2634"></a>                <span class="src-comm">// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)</span></li>
<li><a name="a2635"></a>    </li>
<li><a name="a2636"></a>                <span class="src-comm">// A1 = unq(username-value) &quot;:&quot; unq(realm-value) &quot;:&quot; passwd</span></li>
<li><a name="a2637"></a>                <span class="src-var">$A1 </span>= <span class="src-var">$username</span>. <span class="src-str">':' </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'realm'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'realm'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">':' </span>. <span class="src-var">$password</span><span class="src-sym">;</span></li>
<li><a name="a2638"></a>    </li>
<li><a name="a2639"></a>                <span class="src-comm">// H(A1) = MD5(A1)</span></li>
<li><a name="a2640"></a>                <span class="src-var">$HA1 </span>= <a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$A1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2641"></a>    </li>
<li><a name="a2642"></a>                <span class="src-comm">// A2 = Method &quot;:&quot; digest-uri-value</span></li>
<li><a name="a2643"></a>                <span class="src-var">$A2 </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$request_method">request_method</a> . <span class="src-str">':' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$digest_uri">digest_uri</a><span class="src-sym">;</span></li>
<li><a name="a2644"></a>    </li>
<li><a name="a2645"></a>                <span class="src-comm">// H(A2)</span></li>
<li><a name="a2646"></a>                <span class="src-var">$HA2 </span>=  <a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$A2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2647"></a>    </li>
<li><a name="a2648"></a>                <span class="src-comm">// KD(secret, data) = H(concat(secret, &quot;:&quot;, data))</span></li>
<li><a name="a2649"></a>                <span class="src-comm">// if qop == auth:</span></li>
<li><a name="a2650"></a>                <span class="src-comm">// request-digest  = &lt;&quot;&gt; &lt; KD ( H(A1),     unq(nonce-value)</span></li>
<li><a name="a2651"></a>                <span class="src-comm">//                              &quot;:&quot; nc-value</span></li>
<li><a name="a2652"></a>                <span class="src-comm">//                              &quot;:&quot; unq(cnonce-value)</span></li>
<li><a name="a2653"></a>                <span class="src-comm">//                              &quot;:&quot; unq(qop-value)</span></li>
<li><a name="a2654"></a>                <span class="src-comm">//                              &quot;:&quot; H(A2)</span></li>
<li><a name="a2655"></a>                <span class="src-comm">//                            ) &lt;&quot;&gt;</span></li>
<li><a name="a2656"></a>                <span class="src-comm">// if qop is missing,</span></li>
<li><a name="a2657"></a>                <span class="src-comm">// request-digest  = &lt;&quot;&gt; &lt; KD ( H(A1), unq(nonce-value) &quot;:&quot; H(A2) ) &gt; &lt;&quot;&gt;</span></li>
<li><a name="a2658"></a>    </li>
<li><a name="a2659"></a>                <span class="src-var">$unhashedDigest </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2660"></a>                <span class="src-var">$nonce </span>= isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nonce'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nonce'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2661"></a>                <span class="src-var">$cnonce </span>= <span class="src-var">$nonce</span><span class="src-sym">;</span></li>
<li><a name="a2662"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'qop'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2663"></a>                    <span class="src-var">$unhashedDigest </span>= <span class="src-var">$HA1 </span>. <span class="src-str">':' </span>. <span class="src-var">$nonce </span>. <span class="src-str">':' </span>. <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">&quot;%08d&quot;</span><span class="src-sym">, </span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nc'</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">':' </span>. <span class="src-var">$cnonce </span>. <span class="src-str">':' </span>. <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'qop'</span><span class="src-sym">] </span>. <span class="src-str">':' </span>. <span class="src-var">$HA2</span><span class="src-sym">;</span></li>
<li><a name="a2664"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2665"></a>                    <span class="src-var">$unhashedDigest </span>= <span class="src-var">$HA1 </span>. <span class="src-str">':' </span>. <span class="src-var">$nonce </span>. <span class="src-str">':' </span>. <span class="src-var">$HA2</span><span class="src-sym">;</span></li>
<li><a name="a2666"></a>                <span class="src-sym">}</span></li>
<li><a name="a2667"></a>    </li>
<li><a name="a2668"></a>                <span class="src-var">$hashedDigest </span>= <a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$unhashedDigest</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2669"></a>    </li>
<li><a name="a2670"></a>                <span class="src-var">$opaque </span>= <span class="src-str">''</span><span class="src-sym">;    </span></li>
<li><a name="a2671"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'opaque'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2672"></a>                    <span class="src-var">$opaque </span>= <span class="src-str">', opaque=&quot;' </span>. <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'opaque'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a2673"></a>                <span class="src-sym">}</span></li>
<li><a name="a2674"></a>&nbsp;</li>
<li><a name="a2675"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Authorization'</span><span class="src-sym">, </span><span class="src-str">'Digest username=&quot;' </span>. <span class="src-var">$username </span>. <span class="src-str">'&quot;, realm=&quot;' </span>. <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'realm'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;, nonce=&quot;' </span>. <span class="src-var">$nonce </span>. <span class="src-str">'&quot;, uri=&quot;' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$digest_uri">digest_uri</a> . <span class="src-var">$opaque </span>. <span class="src-str">'&quot;, cnonce=&quot;' </span>. <span class="src-var">$cnonce </span>. <span class="src-str">'&quot;, nc=' </span>. <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">&quot;%08x&quot;</span><span class="src-sym">, </span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nc'</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">', qop=&quot;' </span>. <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'qop'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;, response=&quot;' </span>. <span class="src-var">$hashedDigest </span>. <span class="src-str">'&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2676"></a>            <span class="src-sym">}</span></li>
<li><a name="a2677"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$authtype </span>== <span class="src-str">'certificate'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2678"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$certRequest">certRequest</a> = <span class="src-var">$certRequest</span><span class="src-sym">;</span></li>
<li><a name="a2679"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Authorization header not set for certificate'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2680"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$authtype </span>== <span class="src-str">'ntlm'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2681"></a>            <span class="src-comm">// do nothing</span></li>
<li><a name="a2682"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Authorization header not set for ntlm'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2683"></a>        <span class="src-sym">}</span></li>
<li><a name="a2684"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$username">username</a> = <span class="src-var">$username</span><span class="src-sym">;</span></li>
<li><a name="a2685"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$password">password</a> = <span class="src-var">$password</span><span class="src-sym">;</span></li>
<li><a name="a2686"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$authtype">authtype</a> = <span class="src-var">$authtype</span><span class="src-sym">;</span></li>
<li><a name="a2687"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$digestRequest">digestRequest</a> = <span class="src-var">$digestRequest</span><span class="src-sym">;</span></li>
<li><a name="a2688"></a>    <span class="src-sym">}</span></li>
<li><a name="a2689"></a>    </li>
<li><a name="a2690"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2691"></a><span class="src-doc">    * set the soapaction value</span></li>
<li><a name="a2692"></a><span class="src-doc">    *</span></li>
<li><a name="a2693"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapaction </span></li>
<li><a name="a2694"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2695"></a><span class="src-doc">    */</span></li>
<li><a name="a2696"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetSOAPAction">setSOAPAction</a><span class="src-sym">(</span><span class="src-var">$soapaction</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2697"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'SOAPAction'</span><span class="src-sym">, </span><span class="src-str">'&quot;' </span>. <span class="src-var">$soapaction </span>. <span class="src-str">'&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2698"></a>    <span class="src-sym">}</span></li>
<li><a name="a2699"></a>    </li>
<li><a name="a2700"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2701"></a><span class="src-doc">    * use http encoding</span></li>
<li><a name="a2702"></a><span class="src-doc">    *</span></li>
<li><a name="a2703"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$enc </span><span class="src-doc">encoding style. supported values: gzip, deflate, or both</span></li>
<li><a name="a2704"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2705"></a><span class="src-doc">    */</span></li>
<li><a name="a2706"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetEncoding">setEncoding</a><span class="src-sym">(</span><span class="src-var">$enc</span>=<span class="src-str">'gzip, deflate'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2707"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gzdeflate'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2708"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$protocol_version">protocol_version</a> = <span class="src-str">'1.1'</span><span class="src-sym">;</span></li>
<li><a name="a2709"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Accept-Encoding'</span><span class="src-sym">, </span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2710"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-str">'Connection'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2711"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Connection'</span><span class="src-sym">, </span><span class="src-str">'close'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2712"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2713"></a>            <span class="src-sym">}</span></li>
<li><a name="a2714"></a>            <span class="src-comm">// deprecated as of PHP 5.3.0</span></li>
<li><a name="a2715"></a>            <span class="src-comm">//set_magic_quotes_runtime(0);</span></li>
<li><a name="a2716"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$encoding">encoding</a> = <span class="src-var">$enc</span><span class="src-sym">;</span></li>
<li><a name="a2717"></a>        <span class="src-sym">}</span></li>
<li><a name="a2718"></a>    <span class="src-sym">}</span></li>
<li><a name="a2719"></a>    </li>
<li><a name="a2720"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2721"></a><span class="src-doc">    * set proxy info here</span></li>
<li><a name="a2722"></a><span class="src-doc">    *</span></li>
<li><a name="a2723"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyhost </span><span class="src-doc">use an empty string to remove proxy</span></li>
<li><a name="a2724"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyport </span></li>
<li><a name="a2725"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyusername </span></li>
<li><a name="a2726"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxypassword </span></li>
<li><a name="a2727"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyauthtype </span><span class="src-doc">(basic|ntlm)</span></li>
<li><a name="a2728"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2729"></a><span class="src-doc">    */</span></li>
<li><a name="a2730"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetProxy">setProxy</a><span class="src-sym">(</span><span class="src-var">$proxyhost</span><span class="src-sym">, </span><span class="src-var">$proxyport</span><span class="src-sym">, </span><span class="src-var">$proxyusername </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$proxypassword </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$proxyauthtype </span>= <span class="src-str">'basic'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2731"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$proxyhost</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2732"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a> = <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a2733"></a>                <span class="src-str">'host' </span>=&gt; <span class="src-var">$proxyhost</span><span class="src-sym">,</span></li>
<li><a name="a2734"></a>                <span class="src-str">'port' </span>=&gt; <span class="src-var">$proxyport</span><span class="src-sym">,</span></li>
<li><a name="a2735"></a>                <span class="src-str">'username' </span>=&gt; <span class="src-var">$proxyusername</span><span class="src-sym">,</span></li>
<li><a name="a2736"></a>                <span class="src-str">'password' </span>=&gt; <span class="src-var">$proxypassword</span><span class="src-sym">,</span></li>
<li><a name="a2737"></a>                <span class="src-str">'authtype' </span>=&gt; <span class="src-var">$proxyauthtype</span></li>
<li><a name="a2738"></a>            <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2739"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$proxyusername </span>!= <span class="src-str">'' </span>&amp;&amp; <span class="src-var">$proxypassword </span>!= <span class="src-str">'' </span>&amp;&amp; <span class="src-var">$proxyauthtype </span>= <span class="src-str">'basic'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2740"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Proxy-Authorization'</span><span class="src-sym">, </span><span class="src-str">' Basic '</span>.<a href="http://www.php.net/base64_encode">base64_encode</a><span class="src-sym">(</span><span class="src-var">$proxyusername</span>.<span class="src-str">':'</span>.<span class="src-var">$proxypassword</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2741"></a>            <span class="src-sym">}</span></li>
<li><a name="a2742"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2743"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'remove proxy'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2744"></a>            <span class="src-var">$proxy </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a2745"></a>            <a href="../nusoap/soap_transport_http.html#methodunsetHeader">unsetHeader</a><span class="src-sym">(</span><span class="src-str">'Proxy-Authorization'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2746"></a>        <span class="src-sym">}</span></li>
<li><a name="a2747"></a>    <span class="src-sym">}</span></li>
<li><a name="a2748"></a>    </li>
<li><a name="a2749"></a>&nbsp;</li>
<li><a name="a2750"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2751"></a><span class="src-doc">     * Test if the given string starts with a header that is to be skipped.</span></li>
<li><a name="a2752"></a><span class="src-doc">     * Skippable headers result from chunked transfer and proxy requests.</span></li>
<li><a name="a2753"></a><span class="src-doc">     *</span></li>
<li><a name="a2754"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">The string to check.</span></li>
<li><a name="a2755"></a><span class="src-doc">     * </span><span class="src-doc-tag">@returns</span><span class="src-doc">    boolean    Whether a skippable header was found.</span></li>
<li><a name="a2756"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a2757"></a><span class="src-doc">     */</span></li>
<li><a name="a2758"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodisSkippableCurlHeader">isSkippableCurlHeader</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$data</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2759"></a>        <span class="src-var">$skipHeaders </span>= <span class="src-key">array</span><span class="src-sym">(    </span><span class="src-str">'HTTP/1.1 100'</span><span class="src-sym">,</span></li>
<li><a name="a2760"></a>                                <span class="src-str">'HTTP/1.0 301'</span><span class="src-sym">,</span></li>
<li><a name="a2761"></a>                                <span class="src-str">'HTTP/1.1 301'</span><span class="src-sym">,</span></li>
<li><a name="a2762"></a>                                <span class="src-str">'HTTP/1.0 302'</span><span class="src-sym">,</span></li>
<li><a name="a2763"></a>                                <span class="src-str">'HTTP/1.1 302'</span><span class="src-sym">,</span></li>
<li><a name="a2764"></a>                                <span class="src-str">'HTTP/1.0 401'</span><span class="src-sym">,</span></li>
<li><a name="a2765"></a>                                <span class="src-str">'HTTP/1.1 401'</span><span class="src-sym">,</span></li>
<li><a name="a2766"></a>                                <span class="src-str">'HTTP/1.0 200 Connection established'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2767"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$skipHeaders </span><span class="src-key">as </span><span class="src-var">$hd</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2768"></a>            <span class="src-var">$prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$hd</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2769"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$prefix </span>== <span class="src-var">$hd</span><span class="src-sym">) </span><span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2770"></a>        <span class="src-sym">}</span></li>
<li><a name="a2771"></a>&nbsp;</li>
<li><a name="a2772"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2773"></a>    <span class="src-sym">}</span></li>
<li><a name="a2774"></a>&nbsp;</li>
<li><a name="a2775"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2776"></a><span class="src-doc">    * decode a string that is encoded w/ &quot;chunked' transfer encoding</span></li>
<li><a name="a2777"></a><span class="src-doc">     * as defined in RFC2068 19.4.6</span></li>
<li><a name="a2778"></a><span class="src-doc">    *</span></li>
<li><a name="a2779"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$buffer </span></li>
<li><a name="a2780"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$lb </span></li>
<li><a name="a2781"></a><span class="src-doc">    * </span><span class="src-doc-tag">@returns</span><span class="src-doc">    string</span></li>
<li><a name="a2782"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a2783"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a2784"></a><span class="src-doc">    */</span></li>
<li><a name="a2785"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methoddecodeChunked">decodeChunked</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">, </span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2786"></a>        <span class="src-comm">// length := 0</span></li>
<li><a name="a2787"></a>        <span class="src-var">$length </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a2788"></a>        <span class="src-var">$new </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2789"></a>        </li>
<li><a name="a2790"></a>        <span class="src-comm">// read chunk-size, chunk-extension (if any) and CRLF</span></li>
<li><a name="a2791"></a>        <span class="src-comm">// get the position of the linebreak</span></li>
<li><a name="a2792"></a>        <span class="src-var">$chunkend </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">, </span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2793"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$chunkend </span>== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2794"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no linebreak found in decodeChunked'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2795"></a>            <span class="src-key">return </span><span class="src-var">$new</span><span class="src-sym">;</span></li>
<li><a name="a2796"></a>        <span class="src-sym">}</span></li>
<li><a name="a2797"></a>        <span class="src-var">$temp </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$chunkend</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2798"></a>        <span class="src-var">$chunk_size </span>= <a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">( </span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$temp</span><span class="src-sym">) )</span><span class="src-sym">;</span></li>
<li><a name="a2799"></a>        <span class="src-var">$chunkstart </span>= <span class="src-var">$chunkend </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2800"></a>        <span class="src-comm">// while (chunk-size &gt; 0) {</span></li>
<li><a name="a2801"></a>        <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$chunk_size </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2802"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">chunkstart: <span class="src-var">$chunkstart</span> chunk_size: <span class="src-var">$chunk_size</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2803"></a>            <span class="src-var">$chunkend </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">( </span><span class="src-var">$buffer</span><span class="src-sym">, </span><span class="src-var">$lb</span><span class="src-sym">, </span><span class="src-var">$chunkstart </span>+ <span class="src-var">$chunk_size</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2804"></a>              </li>
<li><a name="a2805"></a>            <span class="src-comm">// Just in case we got a broken connection</span></li>
<li><a name="a2806"></a>              <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$chunkend </span>== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2807"></a>                  <span class="src-var">$chunk </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">,</span><span class="src-var">$chunkstart</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2808"></a>                <span class="src-comm">// append chunk-data to entity-body</span></li>
<li><a name="a2809"></a>                <span class="src-var">$new </span>.= <span class="src-var">$chunk</span><span class="src-sym">;</span></li>
<li><a name="a2810"></a>                  <span class="src-var">$length </span>+= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$chunk</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2811"></a>                  <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a2812"></a>            <span class="src-sym">}</span></li>
<li><a name="a2813"></a>            </li>
<li><a name="a2814"></a>              <span class="src-comm">// read chunk-data and CRLF</span></li>
<li><a name="a2815"></a>              <span class="src-var">$chunk </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">,</span><span class="src-var">$chunkstart</span><span class="src-sym">,</span><span class="src-var">$chunkend</span>-<span class="src-var">$chunkstart</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2816"></a>              <span class="src-comm">// append chunk-data to entity-body</span></li>
<li><a name="a2817"></a>              <span class="src-var">$new </span>.= <span class="src-var">$chunk</span><span class="src-sym">;</span></li>
<li><a name="a2818"></a>              <span class="src-comm">// length := length + chunk-size</span></li>
<li><a name="a2819"></a>              <span class="src-var">$length </span>+= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$chunk</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2820"></a>              <span class="src-comm">// read chunk-size and CRLF</span></li>
<li><a name="a2821"></a>              <span class="src-var">$chunkstart </span>= <span class="src-var">$chunkend </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2822"></a>            </li>
<li><a name="a2823"></a>              <span class="src-var">$chunkend </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">, </span><span class="src-var">$lb</span><span class="src-sym">, </span><span class="src-var">$chunkstart</span><span class="src-sym">) </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2824"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$chunkend </span>== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2825"></a>                <span class="src-key">break</span><span class="src-sym">; </span><span class="src-comm">//Just in case we got a broken connection</span></li>
<li><a name="a2826"></a>            <span class="src-sym">}</span></li>
<li><a name="a2827"></a>            <span class="src-var">$temp </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">,</span><span class="src-var">$chunkstart</span><span class="src-sym">,</span><span class="src-var">$chunkend</span>-<span class="src-var">$chunkstart</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2828"></a>            <span class="src-var">$chunk_size </span>= <a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">( </span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$temp</span><span class="src-sym">) )</span><span class="src-sym">;</span></li>
<li><a name="a2829"></a>            <span class="src-var">$chunkstart </span>= <span class="src-var">$chunkend</span><span class="src-sym">;</span></li>
<li><a name="a2830"></a>        <span class="src-sym">}</span></li>
<li><a name="a2831"></a>        <span class="src-key">return </span><span class="src-var">$new</span><span class="src-sym">;</span></li>
<li><a name="a2832"></a>    <span class="src-sym">}</span></li>
<li><a name="a2833"></a>    </li>
<li><a name="a2834"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2835"></a><span class="src-doc">     * Writes the payload, including HTTP headers, to $this-&gt;outgoing_payload.</span></li>
<li><a name="a2836"></a><span class="src-doc">     *</span></li>
<li><a name="a2837"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">HTTP body</span></li>
<li><a name="a2838"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$cookie_str </span><span class="src-doc">data for HTTP Cookie header</span></li>
<li><a name="a2839"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">void </span></li>
<li><a name="a2840"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a2841"></a><span class="src-doc">     */</span></li>
<li><a name="a2842"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodbuildPayload">buildPayload</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$cookie_str </span>= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2843"></a>        <span class="src-comm">// Note: for cURL connections, $this-&gt;outgoing_payload is ignored,</span></li>
<li><a name="a2844"></a>        <span class="src-comm">// as is the Content-Length header, but these are still created as</span></li>
<li><a name="a2845"></a>        <span class="src-comm">// debugging guides.</span></li>
<li><a name="a2846"></a>&nbsp;</li>
<li><a name="a2847"></a>        <span class="src-comm">// add content-length header</span></li>
<li><a name="a2848"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$request_method">request_method</a> != <span class="src-str">'GET'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2849"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Content-Length'</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2850"></a>        <span class="src-sym">}</span></li>
<li><a name="a2851"></a>&nbsp;</li>
<li><a name="a2852"></a>        <span class="src-comm">// start building outgoing payload:</span></li>
<li><a name="a2853"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$proxy">proxy</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2854"></a>            <span class="src-var">$uri </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$url">url</a><span class="src-sym">;</span></li>
<li><a name="a2855"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2856"></a>            <span class="src-var">$uri </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$uri">uri</a><span class="src-sym">;</span></li>
<li><a name="a2857"></a>        <span class="src-sym">}</span></li>
<li><a name="a2858"></a>        <span class="src-var">$req </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$request_method">request_method</a> <span class="src-var">$uri</span> HTTP/<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$protocol_version">protocol_version</a><span class="src-str">"</span></span><span class="src-sym">;</span></li>
<li><a name="a2859"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">HTTP request: <span class="src-var">$req</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2860"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a> = <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$req</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2861"></a>&nbsp;</li>
<li><a name="a2862"></a>        <span class="src-comm">// loop thru headers, serializing</span></li>
<li><a name="a2863"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a> <span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2864"></a>            <span class="src-var">$hdr </span>= <span class="src-var">$k</span>.<span class="src-str">': '</span>.<span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a2865"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">HTTP header: <span class="src-var">$hdr</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2866"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a> .= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$hdr</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2867"></a>        <span class="src-sym">}</span></li>
<li><a name="a2868"></a>&nbsp;</li>
<li><a name="a2869"></a>        <span class="src-comm">// add any cookies</span></li>
<li><a name="a2870"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$cookie_str </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2871"></a>            <span class="src-var">$hdr </span>= <span class="src-str">'Cookie: '</span>.<span class="src-var">$cookie_str</span><span class="src-sym">;</span></li>
<li><a name="a2872"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">HTTP header: <span class="src-var">$hdr</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2873"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a> .= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$hdr</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2874"></a>        <span class="src-sym">}</span></li>
<li><a name="a2875"></a>&nbsp;</li>
<li><a name="a2876"></a>        <span class="src-comm">// header/body separator</span></li>
<li><a name="a2877"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a> .= <span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2878"></a>        </li>
<li><a name="a2879"></a>        <span class="src-comm">// add data</span></li>
<li><a name="a2880"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a2881"></a>    <span class="src-sym">}</span></li>
<li><a name="a2882"></a>&nbsp;</li>
<li><a name="a2883"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2884"></a><span class="src-doc">    * sends the SOAP request via HTTP[S]</span></li>
<li><a name="a2885"></a><span class="src-doc">    *</span></li>
<li><a name="a2886"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">message data</span></li>
<li><a name="a2887"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$cookies </span><span class="src-doc">cookies to send</span></li>
<li><a name="a2888"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">   true if OK, false if problem</span></li>
<li><a name="a2889"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a2890"></a><span class="src-doc">    */</span></li>
<li><a name="a2891"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsendRequest">sendRequest</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$cookies </span>= <span class="src-id">NULL</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2892"></a>        <span class="src-comm">// build cookie string</span></li>
<li><a name="a2893"></a>        <span class="src-var">$cookie_str </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodgetCookiesForRequest">getCookiesForRequest</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">, </span><span class="src-sym">((</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'ssl'</span><span class="src-sym">) </span>|| <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$scheme">scheme</a> == <span class="src-str">'https'</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a2894"></a>&nbsp;</li>
<li><a name="a2895"></a>        <span class="src-comm">// build payload</span></li>
<li><a name="a2896"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodbuildPayload">buildPayload</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-var">$cookie_str</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2897"></a>&nbsp;</li>
<li><a name="a2898"></a>      <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'socket'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2899"></a>        <span class="src-comm">// send payload</span></li>
<li><a name="a2900"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/fputs">fputs</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a2901"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'couldn\'t write message data to socket'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2902"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'couldn\'t write message data to socket'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2903"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2904"></a>        <span class="src-sym">}</span></li>
<li><a name="a2905"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'wrote data to socket, length = ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_payload">outgoing_payload</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2906"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2907"></a>      <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'curl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2908"></a>        <span class="src-comm">// set payload</span></li>
<li><a name="a2909"></a>        <span class="src-comm">// cURL does say this should only be the verb, and in fact it</span></li>
<li><a name="a2910"></a>        <span class="src-comm">// turns out that the URI and HTTP version are appended to this, which</span></li>
<li><a name="a2911"></a>        <span class="src-comm">// some servers refuse to work with (so we no longer use this method!)</span></li>
<li><a name="a2912"></a>        <span class="src-comm">//$this-&gt;setCurlOption(CURLOPT_CUSTOMREQUEST, $this-&gt;outgoing_payload);</span></li>
<li><a name="a2913"></a>        <span class="src-var">$curl_headers </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2914"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a> <span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2915"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'Connection' </span>|| <span class="src-var">$k </span>== <span class="src-str">'Content-Length' </span>|| <span class="src-var">$k </span>== <span class="src-str">'Host' </span>|| <span class="src-var">$k </span>== <span class="src-str">'Authorization' </span>|| <span class="src-var">$k </span>== <span class="src-str">'Proxy-Authorization'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2916"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Skip cURL header <span class="src-var">$k</span>: <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2917"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2918"></a>                <span class="src-var">$curl_headers</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2919"></a>            <span class="src-sym">}</span></li>
<li><a name="a2920"></a>        <span class="src-sym">}</span></li>
<li><a name="a2921"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$cookie_str </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2922"></a>            <span class="src-var">$curl_headers</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">'Cookie: ' </span>. <span class="src-var">$cookie_str</span><span class="src-sym">;</span></li>
<li><a name="a2923"></a>        <span class="src-sym">}</span></li>
<li><a name="a2924"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_HTTPHEADER</span><span class="src-sym">, </span><span class="src-var">$curl_headers</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2925"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL HTTP headers'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2926"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$request_method">request_method</a> == <span class="src-str">&quot;POST&quot;</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2927"></a>              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_POST</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2928"></a>              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-id">CURLOPT_POSTFIELDS</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2929"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL POST data'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2930"></a>          <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2931"></a>          <span class="src-sym">}</span></li>
<li><a name="a2932"></a>        <span class="src-comm">// insert custom user-set cURL options</span></li>
<li><a name="a2933"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch_options">ch_options</a> <span class="src-key">as </span><span class="src-var">$key </span>=&gt; <span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2934"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">, </span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2935"></a>        <span class="src-sym">}</span></li>
<li><a name="a2936"></a>&nbsp;</li>
<li><a name="a2937"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'set cURL payload'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2938"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a2939"></a>      <span class="src-sym">}</span></li>
<li><a name="a2940"></a>    <span class="src-sym">}</span></li>
<li><a name="a2941"></a>&nbsp;</li>
<li><a name="a2942"></a>    <span class="src-doc">/**</span></li>
<li><a name="a2943"></a><span class="src-doc">    * gets the SOAP response via HTTP[S]</span></li>
<li><a name="a2944"></a><span class="src-doc">    *</span></li>
<li><a name="a2945"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">the response (also sets member variables like incoming_payload)</span></li>
<li><a name="a2946"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a2947"></a><span class="src-doc">    */</span></li>
<li><a name="a2948"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodgetResponse">getResponse</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2949"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2950"></a>        </li>
<li><a name="a2951"></a>      <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'socket'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2952"></a>        <span class="src-comm">// loop until headers have been retrieved</span></li>
<li><a name="a2953"></a>        <span class="src-var">$data </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2954"></a>        <span class="src-key">while </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a2955"></a>&nbsp;</li>
<li><a name="a2956"></a>            <span class="src-comm">// We might EOF during header read.</span></li>
<li><a name="a2957"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2958"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a2959"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'found no headers before EOF after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2960"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;received before EOF:\n&quot; </span>. <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2961"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'server failed to send headers'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2962"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2963"></a>            <span class="src-sym">}</span></li>
<li><a name="a2964"></a>&nbsp;</li>
<li><a name="a2965"></a>            <span class="src-var">$tmp </span>= <a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-num">256</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2966"></a>            <span class="src-var">$tmplen </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2967"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">read line of <span class="src-var">$tmplen</span> bytes: </span><span class="src-str">&quot; </span>. <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2968"></a>&nbsp;</li>
<li><a name="a2969"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tmplen </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a2970"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a2971"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'socket read of headers timed out after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2972"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;read before timeout: &quot; </span>. <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2973"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'socket read of headers timed out'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2974"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a2975"></a>            <span class="src-sym">}</span></li>
<li><a name="a2976"></a>&nbsp;</li>
<li><a name="a2977"></a>            <span class="src-var">$data </span>.= <span class="src-var">$tmp</span><span class="src-sym">;</span></li>
<li><a name="a2978"></a>            <span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\r\n\r\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2979"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$pos </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2980"></a>                <span class="src-var">$lb </span>= <span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2981"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a2982"></a>                <span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2983"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$pos </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a2984"></a>                    <span class="src-var">$lb </span>= <span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a2985"></a>                <span class="src-sym">}</span></li>
<li><a name="a2986"></a>            <span class="src-sym">}</span></li>
<li><a name="a2987"></a>            <span class="src-comm">// remove 100 headers</span></li>
<li><a name="a2988"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^HTTP\/1.1 100/'</span><span class="src-sym">,</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a2989"></a>                unset<span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2990"></a>                <span class="src-var">$data </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a2991"></a>            <span class="src-sym">}</span><span class="src-comm">//</span></li>
<li><a name="a2992"></a>        <span class="src-sym">}</span></li>
<li><a name="a2993"></a>        <span class="src-comm">// store header data</span></li>
<li><a name="a2994"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a2995"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'found end of headers after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2996"></a>        <span class="src-comm">// process headers</span></li>
<li><a name="a2997"></a>        <span class="src-var">$header_data </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a2998"></a>        <span class="src-var">$header_array </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">,</span><span class="src-var">$header_data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a2999"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3000"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_cookies">incoming_cookies</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3001"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$header_array </span><span class="src-key">as </span><span class="src-var">$header_line</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3002"></a>            <span class="src-var">$arr </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,</span><span class="src-var">$header_line</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3003"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">) </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3004"></a>                <span class="src-var">$header_name </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3005"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-var">$header_name</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3006"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$header_name </span>== <span class="src-str">'set-cookie'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3007"></a>                    <span class="src-comm">// TODO: allow multiple cookies from parseCookie</span></li>
<li><a name="a3008"></a>                    <span class="src-var">$cookie </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodparseCookie">parseCookie</a><span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3009"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3010"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_cookies">incoming_cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$cookie</span><span class="src-sym">;</span></li>
<li><a name="a3011"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'found cookie: ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">' = ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3012"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3013"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'did not find cookie in ' </span>. <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3014"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3015"></a>                <span class="src-sym">}</span></li>
<li><a name="a3016"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$header_name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3017"></a>                <span class="src-comm">// append continuation line to previous header</span></li>
<li><a name="a3018"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-var">$header_name</span><span class="src-sym">] </span>.= <span class="src-var">$lb </span>. <span class="src-str">' ' </span>. <span class="src-var">$header_line</span><span class="src-sym">;</span></li>
<li><a name="a3019"></a>            <span class="src-sym">}</span></li>
<li><a name="a3020"></a>        <span class="src-sym">}</span></li>
<li><a name="a3021"></a>        </li>
<li><a name="a3022"></a>        <span class="src-comm">// loop until msg has been received</span></li>
<li><a name="a3023"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'transfer-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'transfer-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>== <span class="src-str">'chunked'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3024"></a>            <span class="src-var">$content_length </span>=  <span class="src-num">2147483647</span><span class="src-sym">;    </span><span class="src-comm">// ignore any content-length header</span></li>
<li><a name="a3025"></a>            <span class="src-var">$chunked </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3026"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;want to read chunked content&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3027"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-length'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3028"></a>            <span class="src-var">$content_length </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-length'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3029"></a>            <span class="src-var">$chunked </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3030"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">want to read content of length <span class="src-var">$content_length</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3031"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3032"></a>            <span class="src-var">$content_length </span>=  <span class="src-num">2147483647</span><span class="src-sym">;</span></li>
<li><a name="a3033"></a>            <span class="src-var">$chunked </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3034"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;want to read content to EOF&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3035"></a>        <span class="src-sym">}</span></li>
<li><a name="a3036"></a>        <span class="src-var">$data </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3037"></a>        do <span class="src-sym">{</span></li>
<li><a name="a3038"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$chunked</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3039"></a>                <span class="src-var">$tmp </span>= <a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-num">256</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3040"></a>                <span class="src-var">$tmplen </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3041"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">read chunk line of <span class="src-var">$tmplen</span> bytes</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3042"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tmplen </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3043"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3044"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'socket read of chunk length timed out after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3045"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;read before timeout:\n&quot; </span>. <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3046"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'socket read of chunk length timed out'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3047"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3048"></a>                <span class="src-sym">}</span></li>
<li><a name="a3049"></a>                <span class="src-var">$content_length </span>= <a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3050"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">chunk length <span class="src-var">$content_length</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3051"></a>            <span class="src-sym">}</span></li>
<li><a name="a3052"></a>            <span class="src-var">$strlen </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a3053"></a>            <span class="src-key">while </span><span class="src-sym">((</span><span class="src-var">$strlen </span>&lt; <span class="src-var">$content_length</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3054"></a>                <span class="src-var">$readlen </span>= <a href="http://www.php.net/min">min</a><span class="src-sym">(</span><span class="src-num">8192</span><span class="src-sym">, </span><span class="src-var">$content_length </span>- <span class="src-var">$strlen</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3055"></a>                <span class="src-var">$tmp </span>= <a href="http://www.php.net/fread">fread</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-var">$readlen</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3056"></a>                <span class="src-var">$tmplen </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3057"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">read buffer of <span class="src-var">$tmplen</span> bytes</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3058"></a>                <span class="src-key">if </span><span class="src-sym">((</span><span class="src-var">$tmplen </span>== <span class="src-num">0</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3059"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3060"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'socket read of body timed out after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3061"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;read before timeout:\n&quot; </span>. <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3062"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'socket read of body timed out'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3063"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3064"></a>                <span class="src-sym">}</span></li>
<li><a name="a3065"></a>                <span class="src-var">$strlen </span>+= <span class="src-var">$tmplen</span><span class="src-sym">;</span></li>
<li><a name="a3066"></a>                <span class="src-var">$data </span>.= <span class="src-var">$tmp</span><span class="src-sym">;</span></li>
<li><a name="a3067"></a>            <span class="src-sym">}</span></li>
<li><a name="a3068"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$chunked </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$content_length </span>&gt; <span class="src-num">0</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3069"></a>                <span class="src-var">$tmp </span>= <a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">, </span><span class="src-num">256</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3070"></a>                <span class="src-var">$tmplen </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$tmp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3071"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">read chunk terminator of <span class="src-var">$tmplen</span> bytes</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3072"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$tmplen </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3073"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3074"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'socket read of chunk terminator timed out after length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3075"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;read before timeout:\n&quot; </span>. <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3076"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'socket read of chunk terminator timed out'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3077"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3078"></a>                <span class="src-sym">}</span></li>
<li><a name="a3079"></a>            <span class="src-sym">}</span></li>
<li><a name="a3080"></a>        <span class="src-sym">} </span><span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$chunked </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$content_length </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a3081"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3082"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'read to EOF'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3083"></a>        <span class="src-sym">}</span></li>
<li><a name="a3084"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'read body of length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3085"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3086"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'received a total of '</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a><span class="src-sym">)</span>.<span class="src-str">' bytes of data from server'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3087"></a>        </li>
<li><a name="a3088"></a>        <span class="src-comm">// close filepointer</span></li>
<li><a name="a3089"></a>        <span class="src-key">if</span><span class="src-sym">(</span></li>
<li><a name="a3090"></a>            <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'connection'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'connection'</span><span class="src-sym">]</span><span class="src-sym">) </span>== <span class="src-str">'close'</span><span class="src-sym">) </span>|| </li>
<li><a name="a3091"></a>            <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a><span class="src-sym">) </span>|| <a href="http://www.php.net/feof">feof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3092"></a>            <a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3093"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">fp </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3094"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'closed socket'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3095"></a>        <span class="src-sym">}</span></li>
<li><a name="a3096"></a>        </li>
<li><a name="a3097"></a>        <span class="src-comm">// connection was closed unexpectedly</span></li>
<li><a name="a3098"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> == <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3099"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no response from server'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3100"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3101"></a>        <span class="src-sym">}</span></li>
<li><a name="a3102"></a>        </li>
<li><a name="a3103"></a>        <span class="src-comm">// decode transfer-encoding</span></li>
<li><a name="a3104"></a><span class="src-comm">//        if(isset($this-&gt;incoming_headers['transfer-encoding']) &amp;&amp; strtolower($this-&gt;incoming_headers['transfer-encoding']) == 'chunked'){</span></li>
<li><a name="a3105"></a><span class="src-comm">//            if(!$data = $this-&gt;decodeChunked($data, $lb)){</span></li>
<li><a name="a3106"></a><span class="src-comm">//                $this-&gt;setError('Decoding of chunked data failed');</span></li>
<li><a name="a3107"></a><span class="src-comm">//                return false;</span></li>
<li><a name="a3108"></a><span class="src-comm">//            }</span></li>
<li><a name="a3109"></a>            <span class="src-comm">//print &quot;&lt;pre&gt;\nde-chunked:\n---------------\n$data\n\n---------------\n&lt;/pre&gt;&quot;;</span></li>
<li><a name="a3110"></a>            <span class="src-comm">// set decoded payload</span></li>
<li><a name="a3111"></a><span class="src-comm">//            $this-&gt;incoming_payload = $header_data.$lb.$lb.$data;</span></li>
<li><a name="a3112"></a><span class="src-comm">//        }</span></li>
<li><a name="a3113"></a>    </li>
<li><a name="a3114"></a>      <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodio_method">io_method</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-str">'curl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3115"></a>        <span class="src-comm">// send and receive</span></li>
<li><a name="a3116"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'send and receive with cURL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3117"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <a href="http://www.php.net/curl_exec">curl_exec</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3118"></a>        <span class="src-var">$data </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a><span class="src-sym">;</span></li>
<li><a name="a3119"></a>&nbsp;</li>
<li><a name="a3120"></a>        <span class="src-var">$cErr </span>= <a href="http://www.php.net/curl_error">curl_error</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3121"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$cErr </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3122"></a>            <span class="src-var">$err </span>= <span class="src-str">'cURL ERROR: '</span>.<a href="http://www.php.net/curl_errno">curl_errno</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">)</span>.<span class="src-str">': '</span>.<span class="src-var">$cErr</span>.<span class="src-str">'&lt;br&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a3123"></a>            <span class="src-comm">// TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE</span></li>
<li><a name="a3124"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/curl_getinfo">curl_getinfo</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3125"></a>                <span class="src-var">$err </span>.= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span>&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3126"></a>            <span class="src-sym">}</span></li>
<li><a name="a3127"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3128"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3129"></a>            <a href="http://www.php.net/curl_close">curl_close</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3130"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3131"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3132"></a>            <span class="src-comm">//echo '&lt;pre&gt;';</span></li>
<li><a name="a3133"></a>            <span class="src-comm">//var_dump(curl_getinfo($this-&gt;ch));</span></li>
<li><a name="a3134"></a>            <span class="src-comm">//echo '&lt;/pre&gt;';</span></li>
<li><a name="a3135"></a>        <span class="src-sym">}</span></li>
<li><a name="a3136"></a>        <span class="src-comm">// close curl</span></li>
<li><a name="a3137"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'No cURL error, closing cURL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3138"></a>        <a href="http://www.php.net/curl_close">curl_close</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$ch">ch</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3139"></a>        </li>
<li><a name="a3140"></a>        <span class="src-comm">// try removing skippable headers</span></li>
<li><a name="a3141"></a>        <span class="src-var">$savedata </span>= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3142"></a>        <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodisSkippableCurlHeader">isSkippableCurlHeader</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3143"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Found HTTP header to skip&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3144"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\r\n\r\n&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3145"></a>                <span class="src-var">$data </span>= <a href="http://www.php.net/ltrim">ltrim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3146"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">) ) </span><span class="src-sym">{</span></li>
<li><a name="a3147"></a>                <span class="src-var">$data </span>= <a href="http://www.php.net/ltrim">ltrim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3148"></a>            <span class="src-sym">}</span></li>
<li><a name="a3149"></a>        <span class="src-sym">}</span></li>
<li><a name="a3150"></a>&nbsp;</li>
<li><a name="a3151"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$data </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3152"></a>            <span class="src-comm">// have nothing left; just remove 100 header(s)</span></li>
<li><a name="a3153"></a>            <span class="src-var">$data </span>= <span class="src-var">$savedata</span><span class="src-sym">;</span></li>
<li><a name="a3154"></a>            <span class="src-key">while </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^HTTP\/1.1 100/'</span><span class="src-sym">,</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3155"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\r\n\r\n&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3156"></a>                    <span class="src-var">$data </span>= <a href="http://www.php.net/ltrim">ltrim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3157"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">) ) </span><span class="src-sym">{</span></li>
<li><a name="a3158"></a>                    <span class="src-var">$data </span>= <a href="http://www.php.net/ltrim">ltrim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3159"></a>                <span class="src-sym">}</span></li>
<li><a name="a3160"></a>            <span class="src-sym">}</span></li>
<li><a name="a3161"></a>        <span class="src-sym">}</span></li>
<li><a name="a3162"></a>        </li>
<li><a name="a3163"></a>        <span class="src-comm">// separate content from HTTP headers</span></li>
<li><a name="a3164"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\r\n\r\n&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3165"></a>            <span class="src-var">$lb </span>= <span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3166"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">( </span><span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3167"></a>            <span class="src-var">$lb </span>= <span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3168"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3169"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no proper separation of headers and document'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3170"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no proper separation of headers and document'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3171"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3172"></a>        <span class="src-sym">}</span></li>
<li><a name="a3173"></a>        <span class="src-var">$header_data </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3174"></a>        <span class="src-var">$header_array </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-var">$lb</span><span class="src-sym">,</span><span class="src-var">$header_data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3175"></a>        <span class="src-var">$data </span>= <a href="http://www.php.net/ltrim">ltrim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$pos</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3176"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'found proper separation of headers and document'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3177"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cleaned data, stringlen: '</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3178"></a>        <span class="src-comm">// clean headers</span></li>
<li><a name="a3179"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$header_array </span><span class="src-key">as </span><span class="src-var">$header_line</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3180"></a>            <span class="src-var">$arr </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,</span><span class="src-var">$header_line</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3181"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">) </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3182"></a>                <span class="src-var">$header_name </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3183"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-var">$header_name</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3184"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$header_name </span>== <span class="src-str">'set-cookie'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3185"></a>                    <span class="src-comm">// TODO: allow multiple cookies from parseCookie</span></li>
<li><a name="a3186"></a>                    <span class="src-var">$cookie </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodparseCookie">parseCookie</a><span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3187"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3188"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_cookies">incoming_cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$cookie</span><span class="src-sym">;</span></li>
<li><a name="a3189"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'found cookie: ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">' = ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3190"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3191"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'did not find cookie in ' </span>. <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3192"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3193"></a>                <span class="src-sym">}</span></li>
<li><a name="a3194"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$header_name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3195"></a>                <span class="src-comm">// append continuation line to previous header</span></li>
<li><a name="a3196"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-var">$header_name</span><span class="src-sym">] </span>.= <span class="src-var">$lb </span>. <span class="src-str">' ' </span>. <span class="src-var">$header_line</span><span class="src-sym">;</span></li>
<li><a name="a3197"></a>            <span class="src-sym">}</span></li>
<li><a name="a3198"></a>        <span class="src-sym">}</span></li>
<li><a name="a3199"></a>      <span class="src-sym">}</span></li>
<li><a name="a3200"></a>&nbsp;</li>
<li><a name="a3201"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$response_status_line">response_status_line</a> = <span class="src-var">$header_array</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3202"></a>        <span class="src-var">$arr </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$response_status_line">response_status_line</a><span class="src-sym">, </span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3203"></a>        <span class="src-var">$http_version </span>= <span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3204"></a>        <span class="src-var">$http_status </span>= <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3205"></a>        <span class="src-var">$http_reason </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$arr</span><span class="src-sym">) </span>&gt; <span class="src-num">2 </span>? <span class="src-var">$arr</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3206"></a>&nbsp;</li>
<li><a name="a3207"></a>         <span class="src-comm">// see if we need to resend the request with http digest authentication</span></li>
<li><a name="a3208"></a>         <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$http_status </span>== <span class="src-num">301 </span>|| <span class="src-var">$http_status </span>== <span class="src-num">302</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3209"></a>             <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Got <span class="src-var">$http_status</span> <span class="src-var">$http_reason</span> with Location: </span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3210"></a>             <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetURL">setURL</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3211"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tryagain </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3212"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3213"></a>        <span class="src-sym">}</span></li>
<li><a name="a3214"></a>&nbsp;</li>
<li><a name="a3215"></a>         <span class="src-comm">// see if we need to resend the request with http digest authentication</span></li>
<li><a name="a3216"></a>         <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'www-authenticate'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$http_status </span>== <span class="src-num">401</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3217"></a>             <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Got 401 <span class="src-var">$http_reason</span> with WWW-Authenticate: </span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'www-authenticate'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3218"></a>             <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'www-authenticate'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">&quot;Digest &quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3219"></a>                 <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Server wants digest authentication'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3220"></a>                 <span class="src-comm">// remove &quot;Digest &quot; from our elements</span></li>
<li><a name="a3221"></a>                 <span class="src-var">$digestString </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'Digest '</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'www-authenticate'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3222"></a>                 </li>
<li><a name="a3223"></a>                 <span class="src-comm">// parse elements into array</span></li>
<li><a name="a3224"></a>                 <span class="src-var">$digestElements </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">, </span><span class="src-var">$digestString</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3225"></a>                 <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$digestElements </span><span class="src-key">as </span><span class="src-var">$val</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3226"></a>                     <span class="src-var">$tempElement </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'='</span><span class="src-sym">, </span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3227"></a>                     <span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-var">$tempElement</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]] </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$tempElement</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3228"></a>                 <span class="src-sym">}</span></li>
<li><a name="a3229"></a>&nbsp;</li>
<li><a name="a3230"></a>                <span class="src-comm">// should have (at least) qop, realm, nonce</span></li>
<li><a name="a3231"></a>                 <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$digestRequest</span><span class="src-sym">[</span><span class="src-str">'nonce'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3232"></a>                     <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetCredentials">setCredentials</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$username">username</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$password">password</a><span class="src-sym">, </span><span class="src-str">'digest'</span><span class="src-sym">, </span><span class="src-var">$digestRequest</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3233"></a>                     <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tryagain </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3234"></a>                     <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3235"></a>                 <span class="src-sym">}</span></li>
<li><a name="a3236"></a>             <span class="src-sym">}</span></li>
<li><a name="a3237"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'HTTP authentication failed'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3238"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'HTTP authentication failed'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3239"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3240"></a>         <span class="src-sym">}</span></li>
<li><a name="a3241"></a>        </li>
<li><a name="a3242"></a>        <span class="src-key">if </span><span class="src-sym">(</span></li>
<li><a name="a3243"></a>            <span class="src-sym">(</span><span class="src-var">$http_status </span>&gt;= <span class="src-num">300 </span>&amp;&amp; <span class="src-var">$http_status </span>&lt;= <span class="src-num">307</span><span class="src-sym">) </span>||</li>
<li><a name="a3244"></a>            <span class="src-sym">(</span><span class="src-var">$http_status </span>&gt;= <span class="src-num">400 </span>&amp;&amp; <span class="src-var">$http_status </span>&lt;= <span class="src-num">417</span><span class="src-sym">) </span>||</li>
<li><a name="a3245"></a>            <span class="src-sym">(</span><span class="src-var">$http_status </span>&gt;= <span class="src-num">501 </span>&amp;&amp; <span class="src-var">$http_status </span>&lt;= <span class="src-num">505</span><span class="src-sym">)</span></li>
<li><a name="a3246"></a>           <span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3247"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Unsupported HTTP response status <span class="src-var">$http_status</span> <span class="src-var">$http_reason</span> (soapclient-&gt;response has contents of the response)</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3248"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3249"></a>        <span class="src-sym">}</span></li>
<li><a name="a3250"></a>&nbsp;</li>
<li><a name="a3251"></a>        <span class="src-comm">// decode content-encoding</span></li>
<li><a name="a3252"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3253"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>== <span class="src-str">'deflate' </span>|| <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>== <span class="src-str">'gzip'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3254"></a>                <span class="src-comm">// if decoding works, use it. else assume data wasn't gzencoded</span></li>
<li><a name="a3255"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gzinflate'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3256"></a>                    <span class="src-comm">//$timer-&gt;setMarker('starting decoding of gzip/deflated content');</span></li>
<li><a name="a3257"></a>                    <span class="src-comm">// IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)</span></li>
<li><a name="a3258"></a>                    <span class="src-comm">// this means there are no Zlib headers, although there should be</span></li>
<li><a name="a3259"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The gzinflate function exists'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3260"></a>                    <span class="src-var">$datalen </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3261"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'deflate'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3262"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$degzdata </span>= <span class="src-sym">@</span><a href="http://www.php.net/gzinflate">gzinflate</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3263"></a>                            <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3264"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The payload has been inflated to ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' bytes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3265"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>&lt; <span class="src-var">$datalen</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3266"></a>                                <span class="src-comm">// test for the case that the payload has been compressed twice</span></li>
<li><a name="a3267"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The inflated payload is smaller than the gzipped one; try again'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3268"></a>                                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$degzdata </span>= <span class="src-sym">@</span><a href="http://www.php.net/gzinflate">gzinflate</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3269"></a>                                    <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3270"></a>                                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The payload has been inflated again to ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' bytes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3271"></a>                                <span class="src-sym">}</span></li>
<li><a name="a3272"></a>                            <span class="src-sym">}</span></li>
<li><a name="a3273"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3274"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Error using gzinflate to inflate the payload'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3275"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Error using gzinflate to inflate the payload'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3276"></a>                        <span class="src-sym">}</span></li>
<li><a name="a3277"></a>                    <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'gzip'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3278"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$degzdata </span>= <span class="src-sym">@</span><a href="http://www.php.net/gzinflate">gzinflate</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-num">10</span><span class="src-sym">))) </span><span class="src-sym">{    </span><span class="src-comm">// do our best</span></li>
<li><a name="a3279"></a>                            <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3280"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The payload has been un-gzipped to ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' bytes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3281"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>&lt; <span class="src-var">$datalen</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3282"></a>                                <span class="src-comm">// test for the case that the payload has been compressed twice</span></li>
<li><a name="a3283"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The un-gzipped payload is smaller than the gzipped one; try again'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3284"></a>                                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$degzdata </span>= <span class="src-sym">@</span><a href="http://www.php.net/gzinflate">gzinflate</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-num">10</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3285"></a>                                    <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3286"></a>                                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The payload has been un-gzipped again to ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' bytes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3287"></a>                                <span class="src-sym">}</span></li>
<li><a name="a3288"></a>                            <span class="src-sym">}</span></li>
<li><a name="a3289"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3290"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Error using gzinflate to un-gzip the payload'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3291"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Error using gzinflate to un-gzip the payload'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3292"></a>                        <span class="src-sym">}</span></li>
<li><a name="a3293"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3294"></a>                    <span class="src-comm">//$timer-&gt;setMarker('finished decoding of gzip/deflated content');</span></li>
<li><a name="a3295"></a>                    <span class="src-comm">//print &quot;&lt;xmp&gt;\nde-inflated:\n---------------\n$data\n-------------\n&lt;/xmp&gt;&quot;;</span></li>
<li><a name="a3296"></a>                    <span class="src-comm">// set decoded payload</span></li>
<li><a name="a3297"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_payload">incoming_payload</a> = <span class="src-var">$header_data</span>.<span class="src-var">$lb</span>.<span class="src-var">$lb</span>.<span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3298"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3299"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3300"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3301"></a>                <span class="src-sym">}</span></li>
<li><a name="a3302"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3303"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Unsupported Content-Encoding ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3304"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Unsupported Content-Encoding ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$incoming_headers">incoming_headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3305"></a>            <span class="src-sym">}</span></li>
<li><a name="a3306"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3307"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'No Content-Encoding header'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3308"></a>        <span class="src-sym">}</span></li>
<li><a name="a3309"></a>        </li>
<li><a name="a3310"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3311"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no data after headers!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3312"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no data present after HTTP headers'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3313"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3314"></a>        <span class="src-sym">}</span></li>
<li><a name="a3315"></a>        </li>
<li><a name="a3316"></a>        <span class="src-key">return </span><span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3317"></a>    <span class="src-sym">}</span></li>
<li><a name="a3318"></a>&nbsp;</li>
<li><a name="a3319"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3320"></a><span class="src-doc">     * sets the content-type for the SOAP message to be sent</span></li>
<li><a name="a3321"></a><span class="src-doc">     *</span></li>
<li><a name="a3322"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">the content type, MIME style</span></li>
<li><a name="a3323"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$charset </span><span class="src-doc">character set used for encoding (or false)</span></li>
<li><a name="a3324"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a3325"></a><span class="src-doc">     */</span></li>
<li><a name="a3326"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodsetContentType">setContentType</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$charset </span>= <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3327"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Content-Type'</span><span class="src-sym">, </span><span class="src-var">$type </span>. <span class="src-sym">(</span><span class="src-var">$charset </span>? <span class="src-str">'; charset=' </span>. <span class="src-var">$charset </span>: <span class="src-str">''</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3328"></a>    <span class="src-sym">}</span></li>
<li><a name="a3329"></a>&nbsp;</li>
<li><a name="a3330"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3331"></a><span class="src-doc">     * specifies that an HTTP persistent connection should be used</span></li>
<li><a name="a3332"></a><span class="src-doc">     *</span></li>
<li><a name="a3333"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">whether the request was honored by this method.</span></li>
<li><a name="a3334"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a3335"></a><span class="src-doc">     */</span></li>
<li><a name="a3336"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodusePersistentConnection">usePersistentConnection</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3337"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-str">'Accept-Encoding'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3338"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3339"></a>        <span class="src-sym">}</span></li>
<li><a name="a3340"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$protocol_version">protocol_version</a> = <span class="src-str">'1.1'</span><span class="src-sym">;</span></li>
<li><a name="a3341"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$persistentConnection">persistentConnection</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3342"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#methodsetHeader">setHeader</a><span class="src-sym">(</span><span class="src-str">'Connection'</span><span class="src-sym">, </span><span class="src-str">'Keep-Alive'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3343"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3344"></a>    <span class="src-sym">}</span></li>
<li><a name="a3345"></a>&nbsp;</li>
<li><a name="a3346"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3347"></a><span class="src-doc">     * parse an incoming Cookie into it's parts</span></li>
<li><a name="a3348"></a><span class="src-doc">     *</span></li>
<li><a name="a3349"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$cookie_str </span><span class="src-doc">content of cookie</span></li>
<li><a name="a3350"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">with data of that cookie</span></li>
<li><a name="a3351"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a3352"></a><span class="src-doc">     */</span></li>
<li><a name="a3353"></a>    <span class="src-comm">/*</span></li>
<li><a name="a3354"></a><span class="src-comm">     * TODO: allow a Set-Cookie string to be parsed into multiple cookies</span></li>
<li><a name="a3355"></a><span class="src-comm">     */</span></li>
<li><a name="a3356"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodparseCookie">parseCookie</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3357"></a>        <span class="src-var">$cookie_str </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'; '</span><span class="src-sym">, </span><span class="src-str">';'</span><span class="src-sym">, </span><span class="src-var">$cookie_str</span><span class="src-sym">) </span>. <span class="src-str">';'</span><span class="src-sym">;</span></li>
<li><a name="a3358"></a>        <span class="src-var">$data </span>= <a href="http://www.php.net/preg_split">preg_split</a><span class="src-sym">(</span><span class="src-str">'/;/'</span><span class="src-sym">, </span><span class="src-var">$cookie_str</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3359"></a>        <span class="src-var">$value_str </span>= <span class="src-var">$data</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3360"></a>&nbsp;</li>
<li><a name="a3361"></a>        <span class="src-var">$cookie_param </span>= <span class="src-str">'domain='</span><span class="src-sym">;</span></li>
<li><a name="a3362"></a>        <span class="src-var">$start </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$cookie_param</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3363"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$start </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3364"></a>            <span class="src-var">$domain </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$start </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$cookie_param</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3365"></a>            <span class="src-var">$domain </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$domain</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$domain</span><span class="src-sym">, </span><span class="src-str">';'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3366"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3367"></a>            <span class="src-var">$domain </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3368"></a>        <span class="src-sym">}</span></li>
<li><a name="a3369"></a>&nbsp;</li>
<li><a name="a3370"></a>        <span class="src-var">$cookie_param </span>= <span class="src-str">'expires='</span><span class="src-sym">;</span></li>
<li><a name="a3371"></a>        <span class="src-var">$start </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$cookie_param</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3372"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$start </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3373"></a>            <span class="src-var">$expires </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$start </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$cookie_param</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3374"></a>            <span class="src-var">$expires </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$expires</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$expires</span><span class="src-sym">, </span><span class="src-str">';'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3375"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3376"></a>            <span class="src-var">$expires </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3377"></a>        <span class="src-sym">}</span></li>
<li><a name="a3378"></a>&nbsp;</li>
<li><a name="a3379"></a>        <span class="src-var">$cookie_param </span>= <span class="src-str">'path='</span><span class="src-sym">;</span></li>
<li><a name="a3380"></a>        <span class="src-var">$start </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$cookie_param</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3381"></a>        <span class="src-key">if </span><span class="src-sym">( </span><span class="src-var">$start </span>&gt; <span class="src-num">0 </span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3382"></a>            <span class="src-var">$path </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$start </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$cookie_param</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3383"></a>            <span class="src-var">$path </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">, </span><span class="src-str">';'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3384"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3385"></a>            <span class="src-var">$path </span>= <span class="src-str">'/'</span><span class="src-sym">;</span></li>
<li><a name="a3386"></a>        <span class="src-sym">}</span></li>
<li><a name="a3387"></a>                        </li>
<li><a name="a3388"></a>        <span class="src-var">$cookie_param </span>= <span class="src-str">';secure;'</span><span class="src-sym">;</span></li>
<li><a name="a3389"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$cookie_str</span><span class="src-sym">, </span><span class="src-var">$cookie_param</span><span class="src-sym">) </span>!== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3390"></a>            <span class="src-var">$secure </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3391"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3392"></a>            <span class="src-var">$secure </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3393"></a>        <span class="src-sym">}</span></li>
<li><a name="a3394"></a>&nbsp;</li>
<li><a name="a3395"></a>        <span class="src-var">$sep_pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$value_str</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3396"></a>&nbsp;</li>
<li><a name="a3397"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$sep_pos</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3398"></a>            <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$value_str</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$sep_pos</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3399"></a>            <span class="src-var">$value </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$value_str</span><span class="src-sym">, </span><span class="src-var">$sep_pos </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3400"></a>            <span class="src-var">$cookie</span>= <span class="src-key">array</span><span class="src-sym">(    </span><span class="src-str">'name' </span>=&gt; <span class="src-var">$name</span><span class="src-sym">,</span></li>
<li><a name="a3401"></a>                            <span class="src-str">'value' </span>=&gt; <span class="src-var">$value</span><span class="src-sym">,</span></li>
<li><a name="a3402"></a>                            <span class="src-str">'domain' </span>=&gt; <span class="src-var">$domain</span><span class="src-sym">,</span></li>
<li><a name="a3403"></a>                            <span class="src-str">'path' </span>=&gt; <span class="src-var">$path</span><span class="src-sym">,</span></li>
<li><a name="a3404"></a>                            <span class="src-str">'expires' </span>=&gt; <span class="src-var">$expires</span><span class="src-sym">,</span></li>
<li><a name="a3405"></a>                            <span class="src-str">'secure' </span>=&gt; <span class="src-var">$secure</span></li>
<li><a name="a3406"></a>                            <span class="src-sym">)</span><span class="src-sym">;        </span></li>
<li><a name="a3407"></a>            <span class="src-key">return </span><span class="src-var">$cookie</span><span class="src-sym">;</span></li>
<li><a name="a3408"></a>        <span class="src-sym">}</span></li>
<li><a name="a3409"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3410"></a>    <span class="src-sym">}</span></li>
<li><a name="a3411"></a>  </li>
<li><a name="a3412"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3413"></a><span class="src-doc">     * sort out cookies for the current request</span></li>
<li><a name="a3414"></a><span class="src-doc">     *</span></li>
<li><a name="a3415"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$cookies </span><span class="src-doc">array with all cookies</span></li>
<li><a name="a3416"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$secure </span><span class="src-doc">is the send-content secure or not?</span></li>
<li><a name="a3417"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">for Cookie-HTTP-Header</span></li>
<li><a name="a3418"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a3419"></a><span class="src-doc">     */</span></li>
<li><a name="a3420"></a>    <span class="src-key">function </span><a href="../nusoap/soap_transport_http.html#methodgetCookiesForRequest">getCookiesForRequest</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">, </span><span class="src-var">$secure</span>=<span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3421"></a>        <span class="src-var">$cookie_str </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3422"></a>        <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">! </span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3423"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$cookies </span><span class="src-key">as </span><span class="src-var">$cookie</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3424"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3425"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a3426"></a>                <span class="src-sym">}</span></li>
<li><a name="a3427"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;check cookie for validity: &quot;</span>.<span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span>.<span class="src-str">'='</span>.<span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3428"></a>                <span class="src-key">if </span><span class="src-sym">((</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3429"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">) </span>&lt;= <a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3430"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cookie has expired'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3431"></a>                        <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a3432"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3433"></a>                <span class="src-sym">}</span></li>
<li><a name="a3434"></a>                <span class="src-key">if </span><span class="src-sym">((</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">]</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3435"></a>                    <span class="src-var">$domain </span>= <a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3436"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">'.*<span class="src-var">$domain</span>$'i</span><span class="src-str">&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$host">host</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3437"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cookie has different domain'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3438"></a>                        <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a3439"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3440"></a>                <span class="src-sym">}</span></li>
<li><a name="a3441"></a>                <span class="src-key">if </span><span class="src-sym">((</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3442"></a>                    <span class="src-var">$path </span>= <a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3443"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">'^<span class="src-var">$path</span>.*'i</span><span class="src-str">&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/soap_transport_http.html#var$path">path</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3444"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cookie is for a different path'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3445"></a>                        <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a3446"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3447"></a>                <span class="src-sym">}</span></li>
<li><a name="a3448"></a>                <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">! </span><span class="src-var">$secure</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'secure'</span><span class="src-sym">]</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'secure'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3449"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'cookie is secure, transport is not'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3450"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a3451"></a>                <span class="src-sym">}</span></li>
<li><a name="a3452"></a>                <span class="src-var">$cookie_str </span>.= <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">'=' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">] </span>. <span class="src-str">'; '</span><span class="src-sym">;</span></li>
<li><a name="a3453"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'add cookie to Cookie-String: ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">'=' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3454"></a>            <span class="src-sym">}</span></li>
<li><a name="a3455"></a>        <span class="src-sym">}</span></li>
<li><a name="a3456"></a>        <span class="src-key">return </span><span class="src-var">$cookie_str</span><span class="src-sym">;</span></li>
<li><a name="a3457"></a>  <span class="src-sym">}</span></li>
<li><a name="a3458"></a><span class="src-sym">}</span></li>
<li><a name="a3459"></a>&nbsp;</li>
<li><a name="a3460"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a3461"></a>&nbsp;</li>
<li><a name="a3462"></a>&nbsp;</li>
<li><a name="a3463"></a>&nbsp;</li>
<li><a name="a3464"></a><span class="src-doc">/**</span></li>
<li><a name="a3465"></a><span class="src-doc">*</span></li>
<li><a name="a3466"></a><span class="src-doc">* nusoap_server allows the user to create a SOAP server</span></li>
<li><a name="a3467"></a><span class="src-doc">* that is capable of receiving messages and returning responses</span></li>
<li><a name="a3468"></a><span class="src-doc">*</span></li>
<li><a name="a3469"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a3470"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a3471"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a3472"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a3473"></a><span class="src-doc">*/</span></li>
<li><a name="a3474"></a><span class="src-key">class </span><a href="../nusoap/nusoap_server.html">nusoap_server</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a3475"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3476"></a><span class="src-doc">     * HTTP headers of request</span></li>
<li><a name="a3477"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">array </span></li>
<li><a name="a3478"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3479"></a><span class="src-doc">     */</span></li>
<li><a name="a3480"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$headers">$headers</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3481"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3482"></a><span class="src-doc">     * HTTP request</span></li>
<li><a name="a3483"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3484"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3485"></a><span class="src-doc">     */</span></li>
<li><a name="a3486"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$request">$request</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3487"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3488"></a><span class="src-doc">     * SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text)</span></li>
<li><a name="a3489"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3490"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3491"></a><span class="src-doc">     */</span></li>
<li><a name="a3492"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$requestHeaders">$requestHeaders</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3493"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3494"></a><span class="src-doc">     * SOAP Headers from request (parsed)</span></li>
<li><a name="a3495"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3496"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3497"></a><span class="src-doc">     */</span></li>
<li><a name="a3498"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$requestHeader">$requestHeader</a> = <span class="src-id">NULL</span><span class="src-sym">;</span></li>
<li><a name="a3499"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3500"></a><span class="src-doc">     * SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text)</span></li>
<li><a name="a3501"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3502"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3503"></a><span class="src-doc">     */</span></li>
<li><a name="a3504"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$document">$document</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3505"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3506"></a><span class="src-doc">     * SOAP payload for request (text)</span></li>
<li><a name="a3507"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3508"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3509"></a><span class="src-doc">     */</span></li>
<li><a name="a3510"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$requestSOAP">$requestSOAP</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3511"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3512"></a><span class="src-doc">     * requested method namespace URI</span></li>
<li><a name="a3513"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3514"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3515"></a><span class="src-doc">     */</span></li>
<li><a name="a3516"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$methodURI">$methodURI</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3517"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3518"></a><span class="src-doc">     * name of method requested</span></li>
<li><a name="a3519"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3520"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3521"></a><span class="src-doc">     */</span></li>
<li><a name="a3522"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$methodname">$methodname</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3523"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3524"></a><span class="src-doc">     * method parameters from request</span></li>
<li><a name="a3525"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">array </span></li>
<li><a name="a3526"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3527"></a><span class="src-doc">     */</span></li>
<li><a name="a3528"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$methodparams">$methodparams</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3529"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3530"></a><span class="src-doc">     * SOAP Action from request</span></li>
<li><a name="a3531"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3532"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3533"></a><span class="src-doc">     */</span></li>
<li><a name="a3534"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$SOAPAction">$SOAPAction</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3535"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3536"></a><span class="src-doc">     * character set encoding of incoming (request) messages</span></li>
<li><a name="a3537"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3538"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3539"></a><span class="src-doc">     */</span></li>
<li><a name="a3540"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$xml_encoding">$xml_encoding</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3541"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3542"></a><span class="src-doc">     * toggles whether the parser decodes element content w/ utf8_decode()</span></li>
<li><a name="a3543"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">boolean </span></li>
<li><a name="a3544"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3545"></a><span class="src-doc">     */</span></li>
<li><a name="a3546"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$decode_utf8">$decode_utf8</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a3547"></a>&nbsp;</li>
<li><a name="a3548"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3549"></a><span class="src-doc">     * HTTP headers of response</span></li>
<li><a name="a3550"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">array </span></li>
<li><a name="a3551"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3552"></a><span class="src-doc">     */</span></li>
<li><a name="a3553"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">$outgoing_headers</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3554"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3555"></a><span class="src-doc">     * HTTP response</span></li>
<li><a name="a3556"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3557"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3558"></a><span class="src-doc">     */</span></li>
<li><a name="a3559"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$response">$response</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3560"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3561"></a><span class="src-doc">     * SOAP headers for response (text or array of soapval or associative array)</span></li>
<li><a name="a3562"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3563"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3564"></a><span class="src-doc">     */</span></li>
<li><a name="a3565"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$responseHeaders">$responseHeaders</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3566"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3567"></a><span class="src-doc">     * SOAP payload for response (text)</span></li>
<li><a name="a3568"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3569"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3570"></a><span class="src-doc">     */</span></li>
<li><a name="a3571"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$responseSOAP">$responseSOAP</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3572"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3573"></a><span class="src-doc">     * method return value to place in response</span></li>
<li><a name="a3574"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3575"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3576"></a><span class="src-doc">     */</span></li>
<li><a name="a3577"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$methodreturn">$methodreturn</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3578"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3579"></a><span class="src-doc">     * whether $methodreturn is a string of literal XML</span></li>
<li><a name="a3580"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">boolean </span></li>
<li><a name="a3581"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3582"></a><span class="src-doc">     */</span></li>
<li><a name="a3583"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$methodreturnisliteralxml">$methodreturnisliteralxml</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3584"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3585"></a><span class="src-doc">     * SOAP fault for response (or false)</span></li>
<li><a name="a3586"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3587"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3588"></a><span class="src-doc">     */</span></li>
<li><a name="a3589"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$fault">$fault</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3590"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3591"></a><span class="src-doc">     * text indication of result (for debugging)</span></li>
<li><a name="a3592"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string </span></li>
<li><a name="a3593"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3594"></a><span class="src-doc">     */</span></li>
<li><a name="a3595"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$result">$result</a> = <span class="src-str">'successful'</span><span class="src-sym">;</span></li>
<li><a name="a3596"></a>&nbsp;</li>
<li><a name="a3597"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3598"></a><span class="src-doc">     * assoc array of operations =&gt; opData; operations are added by the register()</span></li>
<li><a name="a3599"></a><span class="src-doc">     * method or by parsing an external WSDL definition</span></li>
<li><a name="a3600"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">array </span></li>
<li><a name="a3601"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3602"></a><span class="src-doc">     */</span></li>
<li><a name="a3603"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$operations">$operations</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3604"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3605"></a><span class="src-doc">     * wsdl instance (if one)</span></li>
<li><a name="a3606"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3607"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3608"></a><span class="src-doc">     */</span></li>
<li><a name="a3609"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$wsdl">$wsdl</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3610"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3611"></a><span class="src-doc">     * URL for WSDL (if one)</span></li>
<li><a name="a3612"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">mixed </span></li>
<li><a name="a3613"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a3614"></a><span class="src-doc">     */</span></li>
<li><a name="a3615"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">$externalWSDLURL</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3616"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3617"></a><span class="src-doc">     * whether to append debug to response as XML comment</span></li>
<li><a name="a3618"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">boolean </span></li>
<li><a name="a3619"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a3620"></a><span class="src-doc">     */</span></li>
<li><a name="a3621"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_server.html#var$debug_flag">$debug_flag</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a3622"></a>&nbsp;</li>
<li><a name="a3623"></a>&nbsp;</li>
<li><a name="a3624"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3625"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a3626"></a><span class="src-doc">    * the optional parameter is a path to a WSDL file that you'd like to bind the server instance to.</span></li>
<li><a name="a3627"></a><span class="src-doc">    *</span></li>
<li><a name="a3628"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$wsdl </span><span class="src-doc">file path or URL (string), or wsdl instance (object)</span></li>
<li><a name="a3629"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a3630"></a><span class="src-doc">    */</span></li>
<li><a name="a3631"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodnusoap_server">nusoap_server</a><span class="src-sym">(</span><span class="src-var">$wsdl</span>=<span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3632"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3633"></a>        <span class="src-comm">// turn on debugging?</span></li>
<li><a name="a3634"></a>        <span class="src-key">global </span><span class="src-var">$debug</span><span class="src-sym">;</span></li>
<li><a name="a3635"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a3636"></a>&nbsp;</li>
<li><a name="a3637"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3638"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;_SERVER is defined:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3639"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3640"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3641"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;HTTP_SERVER_VARS is defined:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3642"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3643"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3644"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Neither _SERVER nor HTTP_SERVER_VARS is defined.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3645"></a>        <span class="src-sym">}</span></li>
<li><a name="a3646"></a>&nbsp;</li>
<li><a name="a3647"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$debug</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3648"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">In nusoap_server, set debug_flag=<span class="src-var">$debug</span> based on global flag</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3649"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a> = <span class="src-var">$debug</span><span class="src-sym">;</span></li>
<li><a name="a3650"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3651"></a>            <span class="src-var">$qs </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&amp;'</span><span class="src-sym">, </span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3652"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$qs </span><span class="src-key">as </span><span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3653"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">) </span>== <span class="src-str">'debug='</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3654"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In nusoap_server, set debug_flag=&quot; </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">) </span>. <span class="src-str">&quot; based on query string #1&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3655"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3656"></a>                <span class="src-sym">}</span></li>
<li><a name="a3657"></a>            <span class="src-sym">}</span></li>
<li><a name="a3658"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3659"></a>            <span class="src-var">$qs </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&amp;'</span><span class="src-sym">, </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3660"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$qs </span><span class="src-key">as </span><span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3661"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">) </span>== <span class="src-str">'debug='</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3662"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In nusoap_server, set debug_flag=&quot; </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">) </span>. <span class="src-str">&quot; based on query string #2&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3663"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3664"></a>                <span class="src-sym">}</span></li>
<li><a name="a3665"></a>            <span class="src-sym">}</span></li>
<li><a name="a3666"></a>        <span class="src-sym">}</span></li>
<li><a name="a3667"></a>&nbsp;</li>
<li><a name="a3668"></a>        <span class="src-comm">// wsdl</span></li>
<li><a name="a3669"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3670"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In nusoap_server, WSDL is specified&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3671"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">) </span>== <span class="src-str">'wsdl'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3672"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a> = <span class="src-var">$wsdl</span><span class="src-sym">;</span></li>
<li><a name="a3673"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">wsdl</span><span class="src-sym">;</span></li>
<li><a name="a3674"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Use existing wsdl instance from ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3675"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3676"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Create wsdl from ' </span>. <span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3677"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a> = <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a></span><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3678"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a> = <span class="src-var">$wsdl</span><span class="src-sym">;</span></li>
<li><a name="a3679"></a>            <span class="src-sym">}</span></li>
<li><a name="a3680"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3681"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3682"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$err </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3683"></a>                <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'WSDL ERROR: '</span>.<span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3684"></a>            <span class="src-sym">}</span></li>
<li><a name="a3685"></a>        <span class="src-sym">}</span></li>
<li><a name="a3686"></a>    <span class="src-sym">}</span></li>
<li><a name="a3687"></a>&nbsp;</li>
<li><a name="a3688"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3689"></a><span class="src-doc">    * processes request and returns response</span></li>
<li><a name="a3690"></a><span class="src-doc">    *</span></li>
<li><a name="a3691"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">usually is the value of $HTTP_RAW_POST_DATA</span></li>
<li><a name="a3692"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a3693"></a><span class="src-doc">    */</span></li>
<li><a name="a3694"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodservice">service</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3695"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a3696"></a>&nbsp;</li>
<li><a name="a3697"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3698"></a>            <span class="src-var">$rm </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3699"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3700"></a>            <span class="src-var">$rm </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3701"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3702"></a>            <span class="src-var">$rm </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3703"></a>        <span class="src-sym">}</span></li>
<li><a name="a3704"></a>&nbsp;</li>
<li><a name="a3705"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3706"></a>            <span class="src-var">$qs </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3707"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3708"></a>            <span class="src-var">$qs </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'QUERY_STRING'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3709"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3710"></a>            <span class="src-var">$qs </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3711"></a>        <span class="src-sym">}</span></li>
<li><a name="a3712"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">In service, request method=<span class="src-var">$rm</span> query string=<span class="src-var">$qs</span> strlen(\$data)=</span><span class="src-str">&quot; </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3713"></a>&nbsp;</li>
<li><a name="a3714"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$rm </span>== <span class="src-str">'POST'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3715"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, invoke the request&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3716"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodparse_request">parse_request</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3717"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3718"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodinvoke_method">invoke_method</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3719"></a>            <span class="src-sym">}</span></li>
<li><a name="a3720"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3721"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodserialize_return">serialize_return</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3722"></a>            <span class="src-sym">}</span></li>
<li><a name="a3723"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodsend_response">send_response</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3724"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/wsdl/'</span><span class="src-sym">, </span><span class="src-var">$qs</span><span class="src-sym">) )</span><span class="src-sym">{</span></li>
<li><a name="a3725"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, this is a request for WSDL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3726"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3727"></a>              <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">, </span><span class="src-str">&quot;http://&quot;</span><span class="src-sym">) </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{ </span><span class="src-comm">// assume URL</span></li>
<li><a name="a3728"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, re-direct for WSDL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3729"></a>                <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Location: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3730"></a>              <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{ </span><span class="src-comm">// assume file</span></li>
<li><a name="a3731"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, use file passthru for WSDL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3732"></a>                <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">&quot;Content-Type: text/xml\r\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3733"></a>                <span class="src-var">$pos </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">, </span><span class="src-str">&quot;file://&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3734"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>=== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3735"></a>                    <span class="src-var">$filename </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">;</span></li>
<li><a name="a3736"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3737"></a>                    <span class="src-var">$filename </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">, </span><span class="src-var">$pos </span>+ <span class="src-num">7</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3738"></a>                <span class="src-sym">}</span></li>
<li><a name="a3739"></a>                <span class="src-var">$fp </span>= <a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">, </span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3740"></a>                <a href="http://www.php.net/fpassthru">fpassthru</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3741"></a>              <span class="src-sym">}</span></li>
<li><a name="a3742"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3743"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, serialize WSDL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3744"></a>                <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">&quot;Content-Type: text/xml; charset=ISO-8859-1\r\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3745"></a>                print <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">serialize</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3746"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3747"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'wsdl:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3748"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3749"></a>                    print <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetDebugAsXMLComment">getDebugAsXMLComment</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3750"></a>                <span class="src-sym">}</span></li>
<li><a name="a3751"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3752"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, there is no WSDL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3753"></a>                <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">&quot;Content-Type: text/html; charset=ISO-8859-1\r\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3754"></a>                print <span class="src-str">&quot;This service does not provide WSDL&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3755"></a>            <span class="src-sym">}</span></li>
<li><a name="a3756"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3757"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, return Web description&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3758"></a>            print <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">webDescription</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3759"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3760"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In service, no Web description&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3761"></a>            <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">&quot;Content-Type: text/html; charset=ISO-8859-1\r\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3762"></a>            print <span class="src-str">&quot;This service does not provide a Web description&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3763"></a>        <span class="src-sym">}</span></li>
<li><a name="a3764"></a>    <span class="src-sym">}</span></li>
<li><a name="a3765"></a>&nbsp;</li>
<li><a name="a3766"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3767"></a><span class="src-doc">    * parses HTTP request headers.</span></li>
<li><a name="a3768"></a><span class="src-doc">    *</span></li>
<li><a name="a3769"></a><span class="src-doc">    * The following fields are set by this function (when successful)</span></li>
<li><a name="a3770"></a><span class="src-doc">    *</span></li>
<li><a name="a3771"></a><span class="src-doc">    * headers</span></li>
<li><a name="a3772"></a><span class="src-doc">    * request</span></li>
<li><a name="a3773"></a><span class="src-doc">    * xml_encoding</span></li>
<li><a name="a3774"></a><span class="src-doc">    * SOAPAction</span></li>
<li><a name="a3775"></a><span class="src-doc">    *</span></li>
<li><a name="a3776"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a3777"></a><span class="src-doc">    */</span></li>
<li><a name="a3778"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodparse_http_headers">parse_http_headers</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3779"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a3780"></a>&nbsp;</li>
<li><a name="a3781"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$request">request</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3782"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3783"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'getallheaders'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3784"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In parse_http_headers, use getallheaders&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3785"></a>            <span class="src-var">$headers </span>= <span class="src-id">getallheaders</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3786"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$headers </span><span class="src-key">as </span><span class="src-var">$k</span>=&gt;<span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3787"></a>                <span class="src-var">$k </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3788"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a3789"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$request">request</a> .= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3790"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3791"></a>            <span class="src-sym">}</span></li>
<li><a name="a3792"></a>            <span class="src-comm">// get SOAPAction header</span></li>
<li><a name="a3793"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'soapaction'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3794"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'soapaction'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3795"></a>            <span class="src-sym">}</span></li>
<li><a name="a3796"></a>            <span class="src-comm">// get the character encoding of the incoming request</span></li>
<li><a name="a3797"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-str">'='</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3798"></a>                <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">&quot;content-type&quot;</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3799"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^(ISO-8859-1|US-ASCII|UTF-8)$/i'</span><span class="src-sym">,</span><span class="src-var">$enc</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3800"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3801"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3802"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'US-ASCII'</span><span class="src-sym">;</span></li>
<li><a name="a3803"></a>                <span class="src-sym">}</span></li>
<li><a name="a3804"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3805"></a>                <span class="src-comm">// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1</span></li>
<li><a name="a3806"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a3807"></a>            <span class="src-sym">}</span></li>
<li><a name="a3808"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a3809"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In parse_http_headers, use _SERVER&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3810"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$_SERVER </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3811"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">) </span>== <span class="src-str">'HTTP_'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3812"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-str">'-'</span><span class="src-sym">, </span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'_'</span><span class="src-sym">, </span><span class="src-str">' '</span><span class="src-sym">, </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">))))</span><span class="src-sym">;</span></li>
<li><a name="a3813"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3814"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-str">'-'</span><span class="src-sym">, </span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'_'</span><span class="src-sym">, </span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-var">$k</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a3815"></a>                <span class="src-sym">}</span></li>
<li><a name="a3816"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'soapaction'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3817"></a>                    <span class="src-comm">// get SOAPAction header</span></li>
<li><a name="a3818"></a>                    <span class="src-var">$k </span>= <span class="src-str">'SOAPAction'</span><span class="src-sym">;</span></li>
<li><a name="a3819"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3820"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'\\'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3821"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a> = <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a3822"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'content-type'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3823"></a>                    <span class="src-comm">// get the character encoding of the incoming request</span></li>
<li><a name="a3824"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3825"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3826"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3827"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'\\'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3828"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^(ISO-8859-1|US-ASCII|UTF-8)$/i'</span><span class="src-sym">,</span><span class="src-var">$enc</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3829"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3830"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3831"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'US-ASCII'</span><span class="src-sym">;</span></li>
<li><a name="a3832"></a>                        <span class="src-sym">}</span></li>
<li><a name="a3833"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3834"></a>                        <span class="src-comm">// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1</span></li>
<li><a name="a3835"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a3836"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3837"></a>                <span class="src-sym">}</span></li>
<li><a name="a3838"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a3839"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$request">request</a> .= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3840"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3841"></a>            <span class="src-sym">}</span></li>
<li><a name="a3842"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3843"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In parse_http_headers, use HTTP_SERVER_VARS&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3844"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3845"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">) </span>== <span class="src-str">'HTTP_'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3846"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-str">'-'</span><span class="src-sym">, </span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'_'</span><span class="src-sym">, </span><span class="src-str">' '</span><span class="src-sym">, </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">))))</span><span class="src-sym">;                                              </span><span class="src-var">$k </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3847"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3848"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-str">'-'</span><span class="src-sym">, </span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'_'</span><span class="src-sym">, </span><span class="src-str">' '</span><span class="src-sym">, </span><span class="src-var">$k</span><span class="src-sym">)))</span><span class="src-sym">;                                              </span><span class="src-var">$k </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3849"></a>                <span class="src-sym">}</span></li>
<li><a name="a3850"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'soapaction'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3851"></a>                    <span class="src-comm">// get SOAPAction header</span></li>
<li><a name="a3852"></a>                    <span class="src-var">$k </span>= <span class="src-str">'SOAPAction'</span><span class="src-sym">;</span></li>
<li><a name="a3853"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3854"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'\\'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3855"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a> = <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a3856"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>== <span class="src-str">'content-type'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3857"></a>                    <span class="src-comm">// get the character encoding of the incoming request</span></li>
<li><a name="a3858"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3859"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3860"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3861"></a>                        <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'\\'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3862"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^(ISO-8859-1|US-ASCII|UTF-8)$/i'</span><span class="src-sym">,</span><span class="src-var">$enc</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3863"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3864"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3865"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'US-ASCII'</span><span class="src-sym">;</span></li>
<li><a name="a3866"></a>                        <span class="src-sym">}</span></li>
<li><a name="a3867"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3868"></a>                        <span class="src-comm">// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1</span></li>
<li><a name="a3869"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a3870"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3871"></a>                <span class="src-sym">}</span></li>
<li><a name="a3872"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a3873"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$request">request</a> .= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span>\r\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a3874"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span>: <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3875"></a>            <span class="src-sym">}</span></li>
<li><a name="a3876"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3877"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;In parse_http_headers, HTTP headers not accessible&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3878"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;HTTP headers not accessible&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3879"></a>        <span class="src-sym">}</span></li>
<li><a name="a3880"></a>    <span class="src-sym">}</span></li>
<li><a name="a3881"></a>&nbsp;</li>
<li><a name="a3882"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3883"></a><span class="src-doc">    * parses a request</span></li>
<li><a name="a3884"></a><span class="src-doc">    *</span></li>
<li><a name="a3885"></a><span class="src-doc">    * The following fields are set by this function (when successful)</span></li>
<li><a name="a3886"></a><span class="src-doc">    *</span></li>
<li><a name="a3887"></a><span class="src-doc">    * headers</span></li>
<li><a name="a3888"></a><span class="src-doc">    * request</span></li>
<li><a name="a3889"></a><span class="src-doc">    * xml_encoding</span></li>
<li><a name="a3890"></a><span class="src-doc">    * SOAPAction</span></li>
<li><a name="a3891"></a><span class="src-doc">    * request</span></li>
<li><a name="a3892"></a><span class="src-doc">    * requestSOAP</span></li>
<li><a name="a3893"></a><span class="src-doc">    * methodURI</span></li>
<li><a name="a3894"></a><span class="src-doc">    * methodname</span></li>
<li><a name="a3895"></a><span class="src-doc">    * methodparams</span></li>
<li><a name="a3896"></a><span class="src-doc">    * requestHeaders</span></li>
<li><a name="a3897"></a><span class="src-doc">    * document</span></li>
<li><a name="a3898"></a><span class="src-doc">    *</span></li>
<li><a name="a3899"></a><span class="src-doc">    * This sets the fault field on error</span></li>
<li><a name="a3900"></a><span class="src-doc">    *</span></li>
<li><a name="a3901"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">XML string</span></li>
<li><a name="a3902"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a3903"></a><span class="src-doc">    */</span></li>
<li><a name="a3904"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodparse_request">parse_request</a><span class="src-sym">(</span><span class="src-var">$data</span>=<span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3905"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'entering parse_request()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3906"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodparse_http_headers">parse_http_headers</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3907"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got character encoding: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3908"></a>        <span class="src-comm">// uncompress if necessary</span></li>
<li><a name="a3909"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3910"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got content encoding: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3911"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'deflate' </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'gzip'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3912"></a>                <span class="src-comm">// if decoding works, use it. else assume data wasn't gzencoded</span></li>
<li><a name="a3913"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gzuncompress'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3914"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'deflate' </span>&amp;&amp; <span class="src-var">$degzdata </span>= <span class="src-sym">@</span><a href="http://www.php.net/gzuncompress">gzuncompress</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3915"></a>                        <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3916"></a>                    <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'content-encoding'</span><span class="src-sym">] </span>== <span class="src-str">'gzip' </span>&amp;&amp; <span class="src-var">$degzdata </span>= <a href="http://www.php.net/gzinflate">gzinflate</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">, </span><span class="src-num">10</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a3917"></a>                        <span class="src-var">$data </span>= <span class="src-var">$degzdata</span><span class="src-sym">;</span></li>
<li><a name="a3918"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3919"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">, </span><span class="src-str">'Errors occurred when trying to decode the data'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3920"></a>                        <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a3921"></a>                    <span class="src-sym">}</span></li>
<li><a name="a3922"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3923"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">, </span><span class="src-str">'This Server does not support compressed data'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3924"></a>                    <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a3925"></a>                <span class="src-sym">}</span></li>
<li><a name="a3926"></a>            <span class="src-sym">}</span></li>
<li><a name="a3927"></a>        <span class="src-sym">}</span></li>
<li><a name="a3928"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$request">request</a> .= <span class="src-str">&quot;\r\n&quot;</span>.<span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3929"></a>        <span class="src-var">$data </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodparseRequest">parseRequest</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3930"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$requestSOAP">requestSOAP</a> = <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a3931"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'leaving parse_request'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3932"></a>    <span class="src-sym">}</span></li>
<li><a name="a3933"></a>&nbsp;</li>
<li><a name="a3934"></a>    <span class="src-doc">/**</span></li>
<li><a name="a3935"></a><span class="src-doc">    * invokes a PHP function for the requested SOAP method</span></li>
<li><a name="a3936"></a><span class="src-doc">    *</span></li>
<li><a name="a3937"></a><span class="src-doc">    * The following fields are set by this function (when successful)</span></li>
<li><a name="a3938"></a><span class="src-doc">    *</span></li>
<li><a name="a3939"></a><span class="src-doc">    * methodreturn</span></li>
<li><a name="a3940"></a><span class="src-doc">    *</span></li>
<li><a name="a3941"></a><span class="src-doc">    * Note that the PHP function that is called may also set the following</span></li>
<li><a name="a3942"></a><span class="src-doc">    * fields to affect the response sent to the client</span></li>
<li><a name="a3943"></a><span class="src-doc">    *</span></li>
<li><a name="a3944"></a><span class="src-doc">    * responseHeaders</span></li>
<li><a name="a3945"></a><span class="src-doc">    * outgoing_headers</span></li>
<li><a name="a3946"></a><span class="src-doc">    *</span></li>
<li><a name="a3947"></a><span class="src-doc">    * This sets the fault field on error</span></li>
<li><a name="a3948"></a><span class="src-doc">    *</span></li>
<li><a name="a3949"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a3950"></a><span class="src-doc">    */</span></li>
<li><a name="a3951"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodinvoke_method">invoke_method</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3952"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, methodname=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a> . <span class="src-str">' methodURI=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a> . <span class="src-str">' SOAPAction=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3953"></a>&nbsp;</li>
<li><a name="a3954"></a>        <span class="src-comm">//</span></li>
<li><a name="a3955"></a>        <span class="src-comm">// if you are debugging in this area of the code, your service uses a class to implement methods,</span></li>
<li><a name="a3956"></a>        <span class="src-comm">// you use SOAP RPC, and the client is .NET, please be aware of the following...</span></li>
<li><a name="a3957"></a>        <span class="src-comm">// when the .NET wsdl.exe utility generates a proxy, it will remove the '.' or '..' from the</span></li>
<li><a name="a3958"></a>        <span class="src-comm">// method name.  that is fine for naming the .NET methods.  it is not fine for properly constructing</span></li>
<li><a name="a3959"></a>        <span class="src-comm">// the XML request and reading the XML response.  you need to add the RequestElementName and</span></li>
<li><a name="a3960"></a>        <span class="src-comm">// ResponseElementName to the System.Web.Services.Protocols.SoapRpcMethodAttribute that wsdl.exe</span></li>
<li><a name="a3961"></a>        <span class="src-comm">// generates for the method.  these parameters are used to specify the correct XML element names</span></li>
<li><a name="a3962"></a>        <span class="src-comm">// for .NET to use, i.e. the names with the '.' in them.</span></li>
<li><a name="a3963"></a>        <span class="src-comm">//</span></li>
<li><a name="a3964"></a>        <span class="src-var">$orig_methodname </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">;</span></li>
<li><a name="a3965"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3966"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getOperationData</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3967"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, found WSDL operation=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3968"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'opData=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3969"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getOperationDataForSoapAction</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a3970"></a>                <span class="src-comm">// Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element</span></li>
<li><a name="a3971"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, found WSDL soapAction=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$SOAPAction">SOAPAction</a> . <span class="src-str">' for operation=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3972"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'opData=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3973"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a3974"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3975"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, no WSDL for operation=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3976"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">, </span><span class="src-str">&quot;Operation '&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a> . <span class="src-str">&quot;' is not defined in the WSDL for this service&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3977"></a>                <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a3978"></a>            <span class="src-sym">}</span></li>
<li><a name="a3979"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3980"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, no WSDL to validate method'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3981"></a>        <span class="src-sym">}</span></li>
<li><a name="a3982"></a>&nbsp;</li>
<li><a name="a3983"></a>        <span class="src-comm">// if a . is present in $this-&gt;methodname, we see if there is a class in scope,</span></li>
<li><a name="a3984"></a>        <span class="src-comm">// which could be referred to. We will also distinguish between two deliminators,</span></li>
<li><a name="a3985"></a>        <span class="src-comm">// to allow methods to be called a the class or an instance</span></li>
<li><a name="a3986"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-str">'..'</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3987"></a>            <span class="src-var">$delim </span>= <span class="src-str">'..'</span><span class="src-sym">;</span></li>
<li><a name="a3988"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-str">'.'</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3989"></a>            <span class="src-var">$delim </span>= <span class="src-str">'.'</span><span class="src-sym">;</span></li>
<li><a name="a3990"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a3991"></a>            <span class="src-var">$delim </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3992"></a>        <span class="src-sym">}</span></li>
<li><a name="a3993"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, delim=<span class="src-var">$delim</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3994"></a>&nbsp;</li>
<li><a name="a3995"></a>        <span class="src-var">$class </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3996"></a>        <span class="src-var">$method </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a3997"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$delim</span><span class="src-sym">) </span>&gt; <span class="src-num">0 </span>&amp;&amp; <a href="http://www.php.net/substr_count">substr_count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-var">$delim</span><span class="src-sym">) </span>== <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a3998"></a>            <span class="src-var">$try_class </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-var">$delim</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a3999"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/class_exists">class_exists</a><span class="src-sym">(</span><span class="src-var">$try_class</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4000"></a>                <span class="src-comm">// get the class and method name</span></li>
<li><a name="a4001"></a>                <span class="src-var">$class </span>= <span class="src-var">$try_class</span><span class="src-sym">;</span></li>
<li><a name="a4002"></a>                <span class="src-var">$method </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">, </span><span class="src-var">$delim</span><span class="src-sym">) </span>+ <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$delim</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4003"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, class=<span class="src-var">$class</span> method=<span class="src-var">$method</span> delim=<span class="src-var">$delim</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4004"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4005"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, class=<span class="src-var">$try_class</span> not found</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4006"></a>            <span class="src-sym">}</span></li>
<li><a name="a4007"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4008"></a>            <span class="src-var">$try_class </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4009"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in invoke_method, no class to try&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4010"></a>        <span class="src-sym">}</span></li>
<li><a name="a4011"></a>&nbsp;</li>
<li><a name="a4012"></a>        <span class="src-comm">// does method exist?</span></li>
<li><a name="a4013"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$class </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4014"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4015"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, function '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>' not found!</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4016"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$result">result</a> = <span class="src-str">'fault: method not found'</span><span class="src-sym">;</span></li>
<li><a name="a4017"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">,</span><span class="src-str">&quot;</span><span class="src-str">method '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>'('<span class="src-var">$orig_methodname</span>') not defined in service('<span class="src-var">$try_class</span>' '<span class="src-var">$delim</span>')</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4018"></a>                <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4019"></a>            <span class="src-sym">}</span></li>
<li><a name="a4020"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4021"></a>            <span class="src-var">$method_to_compare </span>= <span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/phpversion">phpversion</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">) </span>== <span class="src-str">'4.'</span><span class="src-sym">) </span>? <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$method</span><span class="src-sym">) </span>: <span class="src-var">$method</span><span class="src-sym">;</span></li>
<li><a name="a4022"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$method_to_compare</span><span class="src-sym">, </span><a href="http://www.php.net/get_class_methods">get_class_methods</a><span class="src-sym">(</span><span class="src-var">$class</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a4023"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, method '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>' not found in class '<span class="src-var">$class</span>'!</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4024"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$result">result</a> = <span class="src-str">'fault: method not found'</span><span class="src-sym">;</span></li>
<li><a name="a4025"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">,</span><span class="src-str">&quot;</span><span class="src-str">method '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>'/'<span class="src-var">$method_to_compare</span>'('<span class="src-var">$orig_methodname</span>') not defined in service/'<span class="src-var">$class</span>'('<span class="src-var">$try_class</span>' '<span class="src-var">$delim</span>')</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4026"></a>                <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4027"></a>            <span class="src-sym">}</span></li>
<li><a name="a4028"></a>        <span class="src-sym">}</span></li>
<li><a name="a4029"></a>&nbsp;</li>
<li><a name="a4030"></a>        <span class="src-comm">// evaluate message, getting back parameters</span></li>
<li><a name="a4031"></a>        <span class="src-comm">// verify that request parameters match the method's signature</span></li>
<li><a name="a4032"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodverify_method">verify_method</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4033"></a>            <span class="src-comm">// debug</span></li>
<li><a name="a4034"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'ERROR: request not verified against method signature'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4035"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$result">result</a> = <span class="src-str">'fault: request failed validation against method signature'</span><span class="src-sym">;</span></li>
<li><a name="a4036"></a>            <span class="src-comm">// return fault</span></li>
<li><a name="a4037"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">,</span><span class="src-str">&quot;</span><span class="src-str">Operation '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>' not defined in service.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4038"></a>            <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4039"></a>        <span class="src-sym">}</span></li>
<li><a name="a4040"></a>&nbsp;</li>
<li><a name="a4041"></a>        <span class="src-comm">// if there are parameters to pass</span></li>
<li><a name="a4042"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, params:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4043"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4044"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, calling '<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>'</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4045"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'call_user_func_array'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4046"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$class </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4047"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling function using eval()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4048"></a>                <span class="src-var">$funcCall </span>= <span class="src-str">&quot;</span><span class="src-str">\$this-&gt;methodreturn = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>(</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4049"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4050"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$delim </span>== <span class="src-str">'..'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4051"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling class method using eval()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4052"></a>                    <span class="src-var">$funcCall </span>= <span class="src-str">&quot;\$this-&gt;methodreturn = &quot;</span>.<span class="src-var">$class</span>.<span class="src-str">&quot;::&quot;</span>.<span class="src-var">$method</span>.<span class="src-str">&quot;(&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4053"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4054"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling instance method using eval()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4055"></a>                    <span class="src-comm">// generate unique instance name</span></li>
<li><a name="a4056"></a>                    <span class="src-var">$instname </span>= <span class="src-str">&quot;\$inst_&quot;</span>.<a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4057"></a>                    <span class="src-var">$funcCall </span>= <span class="src-var">$instname</span>.<span class="src-str">&quot; = new &quot;</span>.<span class="src-var">$class</span>.<span class="src-str">&quot;(); &quot;</span><span class="src-sym">;</span></li>
<li><a name="a4058"></a>                    <span class="src-var">$funcCall </span>.= <span class="src-str">&quot;\$this-&gt;methodreturn = &quot;</span>.<span class="src-var">$instname</span>.<span class="src-str">&quot;-&gt;&quot;</span>.<span class="src-var">$method</span>.<span class="src-str">&quot;(&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4059"></a>                <span class="src-sym">}</span></li>
<li><a name="a4060"></a>            <span class="src-sym">}</span></li>
<li><a name="a4061"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4062"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a> <span class="src-key">as </span><span class="src-var">$param</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4063"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$param</span><span class="src-sym">) </span>|| <a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$param</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4064"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">, </span><span class="src-str">'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4065"></a>                        <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4066"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4067"></a>                    <span class="src-var">$funcCall </span>.= <span class="src-str">&quot;</span><span class="src-str">\&quot;<span class="src-var">$param</span>\&quot;,</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4068"></a>                <span class="src-sym">}</span></li>
<li><a name="a4069"></a>                <span class="src-var">$funcCall </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$funcCall</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4070"></a>            <span class="src-sym">}</span></li>
<li><a name="a4071"></a>            <span class="src-var">$funcCall </span>.= <span class="src-str">');'</span><span class="src-sym">;</span></li>
<li><a name="a4072"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, function call: '</span>.<span class="src-var">$funcCall</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4073"></a>            <span class="src-sym">@</span>eval<span class="src-sym">(</span><span class="src-var">$funcCall</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4074"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4075"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$class </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4076"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling function using call_user_func_array()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4077"></a>                <span class="src-var">$call_arg </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-str">"</span></span><span class="src-sym">;    </span><span class="src-comm">// straight assignment changes $this-&gt;methodname to lower case after call_user_func_array()</span></li>
<li><a name="a4078"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$delim </span>== <span class="src-str">'..'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4079"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling class method using call_user_func_array()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4080"></a>                <span class="src-var">$call_arg </span>= <span class="src-key">array </span><span class="src-sym">(</span><span class="src-var">$class</span><span class="src-sym">, </span><span class="src-var">$method</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4081"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4082"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, calling instance method using call_user_func_array()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4083"></a>                <span class="src-var">$instance </span>= <span class="src-key">new </span><span class="src-var">$class </span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4084"></a>                <span class="src-var">$call_arg </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$instance</span><span class="src-sym">, </span><span class="src-var">$method</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4085"></a>            <span class="src-sym">}</span></li>
<li><a name="a4086"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4087"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a> = <a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-var">$call_arg</span><span class="src-sym">, </span><a href="http://www.php.net/array_values">array_values</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4088"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4089"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a> = <a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-var">$call_arg</span><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4090"></a>            <span class="src-sym">}</span></li>
<li><a name="a4091"></a>        <span class="src-sym">}</span></li>
<li><a name="a4092"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in invoke_method, methodreturn:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4093"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4094"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in invoke_method, called method <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>, received data of type </span><span class="src-str">&quot;</span>.<a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4095"></a>    <span class="src-sym">}</span></li>
<li><a name="a4096"></a>&nbsp;</li>
<li><a name="a4097"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4098"></a><span class="src-doc">    * serializes the return value from a PHP function into a full SOAP Envelope</span></li>
<li><a name="a4099"></a><span class="src-doc">    *</span></li>
<li><a name="a4100"></a><span class="src-doc">    * The following fields are set by this function (when successful)</span></li>
<li><a name="a4101"></a><span class="src-doc">    *</span></li>
<li><a name="a4102"></a><span class="src-doc">    * responseSOAP</span></li>
<li><a name="a4103"></a><span class="src-doc">    *</span></li>
<li><a name="a4104"></a><span class="src-doc">    * This sets the fault field on error</span></li>
<li><a name="a4105"></a><span class="src-doc">    *</span></li>
<li><a name="a4106"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a4107"></a><span class="src-doc">    */</span></li>
<li><a name="a4108"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodserialize_return">serialize_return</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4109"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Entering serialize_return methodname: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a> . <span class="src-str">' methodURI: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4110"></a>        <span class="src-comm">// if fault</span></li>
<li><a name="a4111"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">((</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">) </span>== <span class="src-str">'soap_fault'</span><span class="src-sym">) </span>|| <span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">) </span>== <span class="src-str">'nusoap_fault'</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a4112"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got a fault object from method'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4113"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">;</span></li>
<li><a name="a4114"></a>            <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4115"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturnisliteralxml">methodreturnisliteralxml</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4116"></a>            <span class="src-var">$return_val </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">;</span></li>
<li><a name="a4117"></a>        <span class="src-comm">// returned value(s)</span></li>
<li><a name="a4118"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4119"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got a(n) '</span>.<a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">)</span>.<span class="src-str">' from method'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4120"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'serializing return value'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4121"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4122"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4123"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'more than one output part, so use the method return unchanged'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4124"></a>                    <span class="src-var">$opParams </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">;</span></li>
<li><a name="a4125"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>== <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4126"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'exactly one output part, so wrap the method return in a simple array'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4127"></a>                    <span class="src-comm">// TODO: verify that it is not already wrapped!</span></li>
<li><a name="a4128"></a>                    <span class="src-comm">//foreach ($this-&gt;opData['output']['parts'] as $name =&gt; $type) {</span></li>
<li><a name="a4129"></a>                    <span class="src-comm">//    $this-&gt;debug('wrap in element named ' . $name);</span></li>
<li><a name="a4130"></a>                    <span class="src-comm">//}</span></li>
<li><a name="a4131"></a>                    <span class="src-var">$opParams </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4132"></a>                <span class="src-sym">}</span></li>
<li><a name="a4133"></a>                <span class="src-var">$return_val </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">serializeRPCParameters</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a><span class="src-sym">,</span><span class="src-str">'output'</span><span class="src-sym">,</span><span class="src-var">$opParams</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4134"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4135"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4136"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$errstr </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4137"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got wsdl error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4138"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Server'</span><span class="src-sym">, </span><span class="src-str">'unable to serialize result'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4139"></a>                    <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a4140"></a>                <span class="src-sym">}</span></li>
<li><a name="a4141"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4142"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4143"></a>                    <span class="src-var">$return_val </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodreturn">methodreturn</a><span class="src-sym">, </span><span class="src-str">'return'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4144"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4145"></a>                    <span class="src-var">$return_val </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4146"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in absence of WSDL, assume void return for backward compatibility'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4147"></a>                <span class="src-sym">}</span></li>
<li><a name="a4148"></a>            <span class="src-sym">}</span></li>
<li><a name="a4149"></a>        <span class="src-sym">}</span></li>
<li><a name="a4150"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'return value:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4151"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$return_val</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4152"></a>&nbsp;</li>
<li><a name="a4153"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'serializing response'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4154"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4155"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'have WSDL for serialization: style is ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4156"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">] </span>== <span class="src-str">'rpc'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4157"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'style is rpc for serialization: use is ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4158"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">] </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4159"></a>                    <span class="src-comm">// http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace</span></li>
<li><a name="a4160"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4161"></a>                        <span class="src-var">$payload </span>= <span class="src-str">'&lt;ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response xmlns:ns1=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a>.<span class="src-str">'&quot;&gt;'</span>.<span class="src-var">$return_val</span>.<span class="src-str">'&lt;/ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">&quot;Response&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4162"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4163"></a>                        <span class="src-var">$payload </span>= <span class="src-str">'&lt;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response&gt;'</span>.<span class="src-var">$return_val</span>.<span class="src-str">'&lt;/'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a4164"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4165"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4166"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4167"></a>                        <span class="src-var">$payload </span>= <span class="src-str">'&lt;ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response xmlns:ns1=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a>.<span class="src-str">'&quot;&gt;'</span>.<span class="src-var">$return_val</span>.<span class="src-str">'&lt;/ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">&quot;Response&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4168"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4169"></a>                        <span class="src-var">$payload </span>= <span class="src-str">'&lt;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response&gt;'</span>.<span class="src-var">$return_val</span>.<span class="src-str">'&lt;/'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a4170"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4171"></a>                <span class="src-sym">}</span></li>
<li><a name="a4172"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4173"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'style is not rpc for serialization: assume document'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4174"></a>                <span class="src-var">$payload </span>= <span class="src-var">$return_val</span><span class="src-sym">;</span></li>
<li><a name="a4175"></a>            <span class="src-sym">}</span></li>
<li><a name="a4176"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4177"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'do not have WSDL for serialization: assume rpc/encoded'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4178"></a>            <span class="src-var">$payload </span>= <span class="src-str">'&lt;ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">'Response xmlns:ns1=&quot;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a>.<span class="src-str">'&quot;&gt;'</span>.<span class="src-var">$return_val</span>.<span class="src-str">'&lt;/ns1:'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">&quot;Response&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4179"></a>        <span class="src-sym">}</span></li>
<li><a name="a4180"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$result">result</a> = <span class="src-str">'successful'</span><span class="src-sym">;</span></li>
<li><a name="a4181"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4182"></a>            <span class="src-comm">//if($this-&gt;debug_flag){</span></li>
<li><a name="a4183"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4184"></a>            <span class="src-comm">//    }</span></li>
<li><a name="a4185"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4186"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4187"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4188"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4189"></a>            <span class="src-sym">}</span></li>
<li><a name="a4190"></a>            <span class="src-comm">// Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces.</span></li>
<li><a name="a4191"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$responseSOAP">responseSOAP</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserializeEnvelope">serializeEnvelope</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$responseHeaders">responseHeaders</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">usedNamespaces</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$encodingStyle</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4192"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4193"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$responseSOAP">responseSOAP</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserializeEnvelope">serializeEnvelope</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$responseHeaders">responseHeaders</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4194"></a>        <span class="src-sym">}</span></li>
<li><a name="a4195"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Leaving serialize_return&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4196"></a>    <span class="src-sym">}</span></li>
<li><a name="a4197"></a>&nbsp;</li>
<li><a name="a4198"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4199"></a><span class="src-doc">    * sends an HTTP response</span></li>
<li><a name="a4200"></a><span class="src-doc">    *</span></li>
<li><a name="a4201"></a><span class="src-doc">    * The following fields are set by this function (when successful)</span></li>
<li><a name="a4202"></a><span class="src-doc">    *</span></li>
<li><a name="a4203"></a><span class="src-doc">    * outgoing_headers</span></li>
<li><a name="a4204"></a><span class="src-doc">    * response</span></li>
<li><a name="a4205"></a><span class="src-doc">    *</span></li>
<li><a name="a4206"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a4207"></a><span class="src-doc">    */</span></li>
<li><a name="a4208"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodsend_response">send_response</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4209"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Enter send_response'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4210"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4211"></a>            <span class="src-var">$payload </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a><span class="src-sym">-&gt;</span><span class="src-id">serialize</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4212"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;HTTP/1.0 500 Internal Server Error&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4213"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;Status: 500 Internal Server Error&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4214"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4215"></a>            <span class="src-var">$payload </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$responseSOAP">responseSOAP</a><span class="src-sym">;</span></li>
<li><a name="a4216"></a>            <span class="src-comm">// Some combinations of PHP+Web server allow the Status</span></li>
<li><a name="a4217"></a>            <span class="src-comm">// to come through as a header.  Since OK is the default</span></li>
<li><a name="a4218"></a>            <span class="src-comm">// just do nothing.</span></li>
<li><a name="a4219"></a>            <span class="src-comm">// $this-&gt;outgoing_headers[] = &quot;HTTP/1.0 200 OK&quot;;</span></li>
<li><a name="a4220"></a>            <span class="src-comm">// $this-&gt;outgoing_headers[] = &quot;Status: 200 OK&quot;;</span></li>
<li><a name="a4221"></a>        <span class="src-sym">}</span></li>
<li><a name="a4222"></a>        <span class="src-comm">// add debug data if in debug mode</span></li>
<li><a name="a4223"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4224"></a>            <span class="src-var">$payload </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetDebugAsXMLComment">getDebugAsXMLComment</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4225"></a>        <span class="src-sym">}</span></li>
<li><a name="a4226"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;</span><span class="src-str">Server: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$title">title</a> Server v<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$version">version</a><span class="src-str">"</span></span><span class="src-sym">;</span></li>
<li><a name="a4227"></a>        <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/\$Revisio' </span>. <span class="src-str">'n: ([^ ]+)/'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$revision">revision</a><span class="src-sym">, </span><span class="src-var">$rev</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4228"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;</span><span class="src-str">X-SOAP-Server: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$title">title</a>/<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$version">version</a> (</span><span class="src-str">&quot;</span>.<span class="src-var">$rev</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>.<span class="src-str">&quot;)&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4229"></a>        <span class="src-comm">// Let the Web server decide about this</span></li>
<li><a name="a4230"></a>        <span class="src-comm">//$this-&gt;outgoing_headers[] = &quot;Connection: Close\r\n&quot;;</span></li>
<li><a name="a4231"></a>        <span class="src-var">$payload </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodgetHTTPBody">getHTTPBody</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4232"></a>        <span class="src-var">$type </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodgetHTTPContentType">getHTTPContentType</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4233"></a>        <span class="src-var">$charset </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodgetHTTPContentTypeCharset">getHTTPContentTypeCharset</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4234"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;</span><span class="src-str">Content-Type: <span class="src-var">$type</span></span><span class="src-str">&quot; </span>. <span class="src-sym">(</span><span class="src-var">$charset </span>? <span class="src-str">'; charset=' </span>. <span class="src-var">$charset </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4235"></a>        <span class="src-comm">//begin code to compress payload - by John</span></li>
<li><a name="a4236"></a>        <span class="src-comm">// NOTE: there is no way to know whether the Web server will also compress</span></li>
<li><a name="a4237"></a>        <span class="src-comm">// this data.</span></li>
<li><a name="a4238"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">) </span>&gt; <span class="src-num">1024 </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'accept-encoding'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{    </span></li>
<li><a name="a4239"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'accept-encoding'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'gzip'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4240"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gzencode'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4241"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4242"></a>                        <span class="src-var">$payload </span>.= <span class="src-str">&quot;&lt;!-- Content being gzipped --&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4243"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4244"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;Content-Encoding: gzip&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4245"></a>                    <span class="src-var">$payload </span>= <a href="http://www.php.net/gzencode">gzencode</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4246"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4247"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4248"></a>                        <span class="src-var">$payload </span>.= <span class="src-str">&quot;&lt;!-- Content will not be gzipped: no gzencode --&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4249"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4250"></a>                <span class="src-sym">}</span></li>
<li><a name="a4251"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$headers">headers</a><span class="src-sym">[</span><span class="src-str">'accept-encoding'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'deflate'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4252"></a>                <span class="src-comm">// Note: MSIE requires gzdeflate output (no Zlib header and checksum),</span></li>
<li><a name="a4253"></a>                <span class="src-comm">// instead of gzcompress output,</span></li>
<li><a name="a4254"></a>                <span class="src-comm">// which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5)</span></li>
<li><a name="a4255"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'gzdeflate'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4256"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4257"></a>                        <span class="src-var">$payload </span>.= <span class="src-str">&quot;&lt;!-- Content being deflated --&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4258"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4259"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;Content-Encoding: deflate&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4260"></a>                    <span class="src-var">$payload </span>= <a href="http://www.php.net/gzdeflate">gzdeflate</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4261"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4262"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4263"></a>                        <span class="src-var">$payload </span>.= <span class="src-str">&quot;&lt;!-- Content will not be deflated: no gzcompress --&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4264"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4265"></a>                <span class="src-sym">}</span></li>
<li><a name="a4266"></a>            <span class="src-sym">}</span></li>
<li><a name="a4267"></a>        <span class="src-sym">}</span></li>
<li><a name="a4268"></a>        <span class="src-comm">//end code</span></li>
<li><a name="a4269"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">&quot;Content-Length: &quot;</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4270"></a>        <a href="http://www.php.net/reset">reset</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4271"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a> <span class="src-key">as </span><span class="src-var">$hdr</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4272"></a>            <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-var">$hdr</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4273"></a>        <span class="src-sym">}</span></li>
<li><a name="a4274"></a>        print <span class="src-var">$payload</span><span class="src-sym">;</span></li>
<li><a name="a4275"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$response">response</a> = <a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$outgoing_headers">outgoing_headers</a><span class="src-sym">)</span>.<span class="src-str">&quot;\r\n\r\n&quot;</span>.<span class="src-var">$payload</span><span class="src-sym">;</span></li>
<li><a name="a4276"></a>    <span class="src-sym">}</span></li>
<li><a name="a4277"></a>&nbsp;</li>
<li><a name="a4278"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4279"></a><span class="src-doc">    * takes the value that was created by parsing the request</span></li>
<li><a name="a4280"></a><span class="src-doc">    * and compares to the method's signature, if available.</span></li>
<li><a name="a4281"></a><span class="src-doc">    *</span></li>
<li><a name="a4282"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$operation </span><span class="src-doc">   The operation to be invoked</span></li>
<li><a name="a4283"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">   </span><span class="src-doc-var">$request </span><span class="src-doc">   The array of parameter values</span></li>
<li><a name="a4284"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">   Whether the operation was found</span></li>
<li><a name="a4285"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a4286"></a><span class="src-doc">    */</span></li>
<li><a name="a4287"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodverify_method">verify_method</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">,</span><span class="src-var">$request</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4288"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4289"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">getOperationData</span><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4290"></a>                <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4291"></a>            <span class="src-sym">}</span></li>
<li><a name="a4292"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$operations">operations</a><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4293"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4294"></a>        <span class="src-sym">}</span></li>
<li><a name="a4295"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4296"></a>    <span class="src-sym">}</span></li>
<li><a name="a4297"></a>&nbsp;</li>
<li><a name="a4298"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4299"></a><span class="src-doc">    * processes SOAP message received from client</span></li>
<li><a name="a4300"></a><span class="src-doc">    *</span></li>
<li><a name="a4301"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">   </span><span class="src-doc-var">$headers </span><span class="src-doc">   The HTTP headers</span></li>
<li><a name="a4302"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$data </span><span class="src-doc">       unprocessed request data from client</span></li>
<li><a name="a4303"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   value of the message, decoded into a PHP type</span></li>
<li><a name="a4304"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a4305"></a><span class="src-doc">    */</span></li>
<li><a name="a4306"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodparseRequest">parseRequest</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4307"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Entering parseRequest() for data of length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' headers:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4308"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4309"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4310"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Request not of type text/xml (no content-type header)'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4311"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4312"></a>        <span class="src-sym">}</span></li>
<li><a name="a4313"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'text/xml'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4314"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Request not of type text/xml'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4315"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4316"></a>        <span class="src-sym">}</span></li>
<li><a name="a4317"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4318"></a>            <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">&quot;content-type&quot;</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4319"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Got response encoding: ' </span>. <span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4320"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^(ISO-8859-1|US-ASCII|UTF-8)$/i'</span><span class="src-sym">,</span><span class="src-var">$enc</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4321"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4322"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4323"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'US-ASCII'</span><span class="src-sym">;</span></li>
<li><a name="a4324"></a>            <span class="src-sym">}</span></li>
<li><a name="a4325"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4326"></a>            <span class="src-comm">// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1</span></li>
<li><a name="a4327"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a4328"></a>        <span class="src-sym">}</span></li>
<li><a name="a4329"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Use encoding: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a> . <span class="src-str">' when creating nusoap_parser'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4330"></a>        <span class="src-comm">// parse response, get soap parser obj</span></li>
<li><a name="a4331"></a>        <span class="src-var">$parser </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_parser.html">nusoap_parser</a></span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$xml_encoding">xml_encoding</a><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$decode_utf8">decode_utf8</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4332"></a>        <span class="src-comm">// parser debug</span></li>
<li><a name="a4333"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;parser debug: \n&quot;</span>.<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4334"></a>        <span class="src-comm">// if fault occurred during message parsing</span></li>
<li><a name="a4335"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$err </span>= <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4336"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$result">result</a> = <span class="src-str">'fault: error in msg parsing: '</span>.<span class="src-var">$err</span><span class="src-sym">;</span></li>
<li><a name="a4337"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-str">'SOAP-ENV:Client'</span><span class="src-sym">,</span><span class="src-str">&quot;error in msg parsing:\n&quot;</span>.<span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4338"></a>        <span class="src-comm">// else successfully parsed request into soapval object</span></li>
<li><a name="a4339"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4340"></a>            <span class="src-comm">// get/set methodname</span></li>
<li><a name="a4341"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">root_struct_namespace</span><span class="src-sym">;</span></li>
<li><a name="a4342"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">root_struct_name</span><span class="src-sym">;</span></li>
<li><a name="a4343"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'methodname: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodname">methodname</a>.<span class="src-str">' methodURI: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodURI">methodURI</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4344"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling parser-&gt;get_soapbody()'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4345"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$methodparams">methodparams</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">get_soapbody</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4346"></a>            <span class="src-comm">// get SOAP headers</span></li>
<li><a name="a4347"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$requestHeaders">requestHeaders</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaders</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4348"></a>            <span class="src-comm">// get SOAP Header</span></li>
<li><a name="a4349"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$requestHeader">requestHeader</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">get_soapheader</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4350"></a>            <span class="src-comm">// add document for doclit support</span></li>
<li><a name="a4351"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$document">document</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">document</span><span class="src-sym">;</span></li>
<li><a name="a4352"></a>        <span class="src-sym">}</span></li>
<li><a name="a4353"></a>     <span class="src-sym">}</span></li>
<li><a name="a4354"></a>&nbsp;</li>
<li><a name="a4355"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4356"></a><span class="src-doc">    * gets the HTTP body for the current response.</span></li>
<li><a name="a4357"></a><span class="src-doc">    *</span></li>
<li><a name="a4358"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapmsg </span><span class="src-doc">The SOAP payload</span></li>
<li><a name="a4359"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The HTTP body, which includes the SOAP payload</span></li>
<li><a name="a4360"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a4361"></a><span class="src-doc">    */</span></li>
<li><a name="a4362"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodgetHTTPBody">getHTTPBody</a><span class="src-sym">(</span><span class="src-var">$soapmsg</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4363"></a>        <span class="src-key">return </span><span class="src-var">$soapmsg</span><span class="src-sym">;</span></li>
<li><a name="a4364"></a>    <span class="src-sym">}</span></li>
<li><a name="a4365"></a>    </li>
<li><a name="a4366"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4367"></a><span class="src-doc">    * gets the HTTP content type for the current response.</span></li>
<li><a name="a4368"></a><span class="src-doc">    *</span></li>
<li><a name="a4369"></a><span class="src-doc">    * Note: getHTTPBody must be called before this.</span></li>
<li><a name="a4370"></a><span class="src-doc">    *</span></li>
<li><a name="a4371"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">the HTTP content type for the current response.</span></li>
<li><a name="a4372"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a4373"></a><span class="src-doc">    */</span></li>
<li><a name="a4374"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodgetHTTPContentType">getHTTPContentType</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4375"></a>        <span class="src-key">return </span><span class="src-str">'text/xml'</span><span class="src-sym">;</span></li>
<li><a name="a4376"></a>    <span class="src-sym">}</span></li>
<li><a name="a4377"></a>    </li>
<li><a name="a4378"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4379"></a><span class="src-doc">    * gets the HTTP content type charset for the current response.</span></li>
<li><a name="a4380"></a><span class="src-doc">    * returns false for non-text content types.</span></li>
<li><a name="a4381"></a><span class="src-doc">    *</span></li>
<li><a name="a4382"></a><span class="src-doc">    * Note: getHTTPBody must be called before this.</span></li>
<li><a name="a4383"></a><span class="src-doc">    *</span></li>
<li><a name="a4384"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">the HTTP content type charset for the current response.</span></li>
<li><a name="a4385"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a4386"></a><span class="src-doc">    */</span></li>
<li><a name="a4387"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodgetHTTPContentTypeCharset">getHTTPContentTypeCharset</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4388"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a><span class="src-sym">;</span></li>
<li><a name="a4389"></a>    <span class="src-sym">}</span></li>
<li><a name="a4390"></a>&nbsp;</li>
<li><a name="a4391"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4392"></a><span class="src-doc">    * add a method to the dispatch map (this has been replaced by the register method)</span></li>
<li><a name="a4393"></a><span class="src-doc">    *</span></li>
<li><a name="a4394"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$methodname </span></li>
<li><a name="a4395"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$in </span><span class="src-doc">array of input values</span></li>
<li><a name="a4396"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$out </span><span class="src-doc">array of output values</span></li>
<li><a name="a4397"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a4398"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a4399"></a><span class="src-doc">    */</span></li>
<li><a name="a4400"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodadd_to_map">add_to_map</a><span class="src-sym">(</span><span class="src-var">$methodname</span><span class="src-sym">,</span><span class="src-var">$in</span><span class="src-sym">,</span><span class="src-var">$out</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4401"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$operations">operations</a><span class="src-sym">[</span><span class="src-var">$methodname</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$methodname</span><span class="src-sym">,</span><span class="src-str">'in' </span>=&gt; <span class="src-var">$in</span><span class="src-sym">,</span><span class="src-str">'out' </span>=&gt; <span class="src-var">$out</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4402"></a>    <span class="src-sym">}</span></li>
<li><a name="a4403"></a>&nbsp;</li>
<li><a name="a4404"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4405"></a><span class="src-doc">    * register a service function with the server</span></li>
<li><a name="a4406"></a><span class="src-doc">    *</span></li>
<li><a name="a4407"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">the name of the PHP function, class.method or class..method</span></li>
<li><a name="a4408"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$in </span><span class="src-doc">assoc array of input values: key = param name, value = param type</span></li>
<li><a name="a4409"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$out </span><span class="src-doc">assoc array of output values: key = param name, value = param type</span></li>
<li><a name="a4410"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$namespace </span><span class="src-doc">the element namespace for the method or false</span></li>
<li><a name="a4411"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$soapaction </span><span class="src-doc">the soapaction for the method or false</span></li>
<li><a name="a4412"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$style </span><span class="src-doc">optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically</span></li>
<li><a name="a4413"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$use </span><span class="src-doc">optional (encoded|literal) or false</span></li>
<li><a name="a4414"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$documentation </span><span class="src-doc">optional Description to include in WSDL</span></li>
<li><a name="a4415"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$encodingStyle </span><span class="src-doc">optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)</span></li>
<li><a name="a4416"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a4417"></a><span class="src-doc">    */</span></li>
<li><a name="a4418"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodregister">register</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$in</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$out</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$namespace</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$soapaction</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$style</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$documentation</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$encodingStyle</span>=<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4419"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a4420"></a>&nbsp;</li>
<li><a name="a4421"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$externalWSDLURL">externalWSDLURL</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4422"></a>            <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4423"></a>        <span class="src-sym">}</span></li>
<li><a name="a4424"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4425"></a>            <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'You must specify a name when you register an operation'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4426"></a>        <span class="src-sym">}</span></li>
<li><a name="a4427"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$in</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4428"></a>            <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'You must provide an array for operation inputs'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4429"></a>        <span class="src-sym">}</span></li>
<li><a name="a4430"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$out</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4431"></a>            <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">'You must provide an array for operation outputs'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4432"></a>        <span class="src-sym">}</span></li>
<li><a name="a4433"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$namespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4434"></a>        <span class="src-sym">}</span></li>
<li><a name="a4435"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$soapaction</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4436"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4437"></a>                <span class="src-var">$SERVER_NAME </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SERVER_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4438"></a>                <span class="src-var">$SCRIPT_NAME </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">] </span>: <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4439"></a>                <span class="src-var">$HTTPS </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-str">'off'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4440"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4441"></a>                <span class="src-var">$SERVER_NAME </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'SERVER_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4442"></a>                <span class="src-var">$SCRIPT_NAME </span>= isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">] </span>: <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4443"></a>                <span class="src-var">$HTTPS </span>= isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-str">'off'</span><span class="src-sym">;</span></li>
<li><a name="a4444"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4445"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;Neither _SERVER nor HTTP_SERVER_VARS is available&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4446"></a>            <span class="src-sym">}</span></li>
<li><a name="a4447"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$HTTPS </span>== <span class="src-str">'1' </span>|| <span class="src-var">$HTTPS </span>== <span class="src-str">'on'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4448"></a>                <span class="src-var">$SCHEME </span>= <span class="src-str">'https'</span><span class="src-sym">;</span></li>
<li><a name="a4449"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4450"></a>                <span class="src-var">$SCHEME </span>= <span class="src-str">'http'</span><span class="src-sym">;</span></li>
<li><a name="a4451"></a>            <span class="src-sym">}</span></li>
<li><a name="a4452"></a>            <span class="src-var">$soapaction </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$SCHEME</span>://<span class="src-var">$SERVER_NAME$SCRIPT_NAME</span>/<span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4453"></a>        <span class="src-sym">}</span></li>
<li><a name="a4454"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$style</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4455"></a>            <span class="src-var">$style </span>= <span class="src-str">&quot;rpc&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4456"></a>        <span class="src-sym">}</span></li>
<li><a name="a4457"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$use</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4458"></a>            <span class="src-var">$use </span>= <span class="src-str">&quot;encoded&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4459"></a>        <span class="src-sym">}</span></li>
<li><a name="a4460"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'encoded' </span>&amp;&amp; <span class="src-var">$encodingStyle </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4461"></a>            <span class="src-var">$encodingStyle </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">;</span></li>
<li><a name="a4462"></a>        <span class="src-sym">}</span></li>
<li><a name="a4463"></a>&nbsp;</li>
<li><a name="a4464"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$operations">operations</a><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a4465"></a>        <span class="src-str">'name' </span>=&gt; <span class="src-var">$name</span><span class="src-sym">,</span></li>
<li><a name="a4466"></a>        <span class="src-str">'in' </span>=&gt; <span class="src-var">$in</span><span class="src-sym">,</span></li>
<li><a name="a4467"></a>        <span class="src-str">'out' </span>=&gt; <span class="src-var">$out</span><span class="src-sym">,</span></li>
<li><a name="a4468"></a>        <span class="src-str">'namespace' </span>=&gt; <span class="src-var">$namespace</span><span class="src-sym">,</span></li>
<li><a name="a4469"></a>        <span class="src-str">'soapaction' </span>=&gt; <span class="src-var">$soapaction</span><span class="src-sym">,</span></li>
<li><a name="a4470"></a>        <span class="src-str">'style' </span>=&gt; <span class="src-var">$style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4471"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4472"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">addOperation</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$in</span><span class="src-sym">,</span><span class="src-var">$out</span><span class="src-sym">,</span><span class="src-var">$namespace</span><span class="src-sym">,</span><span class="src-var">$soapaction</span><span class="src-sym">,</span><span class="src-var">$style</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">,</span><span class="src-var">$documentation</span><span class="src-sym">,</span><span class="src-var">$encodingStyle</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4473"></a>        <span class="src-sym">}</span></li>
<li><a name="a4474"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4475"></a>    <span class="src-sym">}</span></li>
<li><a name="a4476"></a>&nbsp;</li>
<li><a name="a4477"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4478"></a><span class="src-doc">    * Specify a fault to be returned to the client.</span></li>
<li><a name="a4479"></a><span class="src-doc">    * This also acts as a flag to the server that a fault has occured.</span></li>
<li><a name="a4480"></a><span class="src-doc">    *</span></li>
<li><a name="a4481"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultcode </span></li>
<li><a name="a4482"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultstring </span></li>
<li><a name="a4483"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultactor </span></li>
<li><a name="a4484"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$faultdetail </span></li>
<li><a name="a4485"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a4486"></a><span class="src-doc">    */</span></li>
<li><a name="a4487"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodfault">fault</a><span class="src-sym">(</span><span class="src-var">$faultcode</span><span class="src-sym">,</span><span class="src-var">$faultstring</span><span class="src-sym">,</span><span class="src-var">$faultactor</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$faultdetail</span>=<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4488"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$faultdetail </span>== <span class="src-str">'' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$debug_flag">debug_flag</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4489"></a>            <span class="src-var">$faultdetail </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetDebug">getDebug</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4490"></a>        <span class="src-sym">}</span></li>
<li><a name="a4491"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a> = <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_fault.html">nusoap_fault</a></span><span class="src-sym">(</span><span class="src-var">$faultcode</span><span class="src-sym">,</span><span class="src-var">$faultactor</span><span class="src-sym">,</span><span class="src-var">$faultstring</span><span class="src-sym">,</span><span class="src-var">$faultdetail</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4492"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$fault">fault</a><span class="src-sym">-&gt;</span><span class="src-id">soap_defencoding </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a><span class="src-sym">;</span></li>
<li><a name="a4493"></a>    <span class="src-sym">}</span></li>
<li><a name="a4494"></a>&nbsp;</li>
<li><a name="a4495"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4496"></a><span class="src-doc">    * Sets up wsdl object.</span></li>
<li><a name="a4497"></a><span class="src-doc">    * Acts as a flag to enable internal WSDL generation</span></li>
<li><a name="a4498"></a><span class="src-doc">    *</span></li>
<li><a name="a4499"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$serviceName, </span><span class="src-doc">name of the service</span></li>
<li><a name="a4500"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$namespace </span><span class="src-doc">optional 'tns' service namespace or false</span></li>
<li><a name="a4501"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$endpoint </span><span class="src-doc">optional URL of service endpoint or false</span></li>
<li><a name="a4502"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$style </span><span class="src-doc">optional (rpc|document) WSDL style (also specified by operation)</span></li>
<li><a name="a4503"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$transport </span><span class="src-doc">optional SOAP transport</span></li>
<li><a name="a4504"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$schemaTargetNamespace </span><span class="src-doc">optional 'types' targetNamespace for service schema or false</span></li>
<li><a name="a4505"></a><span class="src-doc">    */</span></li>
<li><a name="a4506"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_server.html#methodconfigureWSDL">configureWSDL</a><span class="src-sym">(</span><span class="src-var">$serviceName</span><span class="src-sym">,</span><span class="src-var">$namespace </span>= <span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$endpoint </span>= <span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$style</span>=<span class="src-str">'rpc'</span><span class="src-sym">, </span><span class="src-var">$transport </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/http'</span><span class="src-sym">, </span><span class="src-var">$schemaTargetNamespace </span>= <span class="src-id">false</span><span class="src-sym">)</span></li>
<li><a name="a4507"></a>    <span class="src-sym">{</span></li>
<li><a name="a4508"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a4509"></a>&nbsp;</li>
<li><a name="a4510"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4511"></a>            <span class="src-var">$SERVER_NAME </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SERVER_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4512"></a>            <span class="src-var">$SERVER_PORT </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SERVER_PORT'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4513"></a>            <span class="src-var">$SCRIPT_NAME </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">] </span>: <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4514"></a>            <span class="src-var">$HTTPS </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-str">'off'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4515"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4516"></a>            <span class="src-var">$SERVER_NAME </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'SERVER_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4517"></a>            <span class="src-var">$SERVER_PORT </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'SERVER_PORT'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4518"></a>            <span class="src-var">$SCRIPT_NAME </span>= isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">] </span>: <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4519"></a>            <span class="src-var">$HTTPS </span>= isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">] </span>: <span class="src-str">'off'</span><span class="src-sym">;</span></li>
<li><a name="a4520"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4521"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;Neither _SERVER nor HTTP_SERVER_VARS is available&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4522"></a>        <span class="src-sym">}</span></li>
<li><a name="a4523"></a>        <span class="src-comm">// If server name has port number attached then strip it (else port number gets duplicated in WSDL output) (occurred using lighttpd and FastCGI)</span></li>
<li><a name="a4524"></a>        <span class="src-var">$colon </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$SERVER_NAME</span><span class="src-sym">,</span><span class="src-str">&quot;:&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4525"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$colon</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4526"></a>            <span class="src-var">$SERVER_NAME </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$SERVER_NAME</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$colon</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4527"></a>        <span class="src-sym">}</span></li>
<li><a name="a4528"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$SERVER_PORT </span>== <span class="src-num">80</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4529"></a>            <span class="src-var">$SERVER_PORT </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4530"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4531"></a>            <span class="src-var">$SERVER_PORT </span>= <span class="src-str">':' </span>. <span class="src-var">$SERVER_PORT</span><span class="src-sym">;</span></li>
<li><a name="a4532"></a>        <span class="src-sym">}</span></li>
<li><a name="a4533"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$namespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4534"></a>            <span class="src-var">$namespace </span>= <span class="src-str">&quot;</span><span class="src-str">http://<span class="src-var">$SERVER_NAME</span>/soap/<span class="src-var">$serviceName</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4535"></a>        <span class="src-sym">}</span></li>
<li><a name="a4536"></a>        </li>
<li><a name="a4537"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$endpoint</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4538"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$HTTPS </span>== <span class="src-str">'1' </span>|| <span class="src-var">$HTTPS </span>== <span class="src-str">'on'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4539"></a>                <span class="src-var">$SCHEME </span>= <span class="src-str">'https'</span><span class="src-sym">;</span></li>
<li><a name="a4540"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4541"></a>                <span class="src-var">$SCHEME </span>= <span class="src-str">'http'</span><span class="src-sym">;</span></li>
<li><a name="a4542"></a>            <span class="src-sym">}</span></li>
<li><a name="a4543"></a>            <span class="src-var">$endpoint </span>= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$SCHEME</span>://<span class="src-var">$SERVER_NAME$SERVER_PORT$SCRIPT_NAME</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4544"></a>        <span class="src-sym">}</span></li>
<li><a name="a4545"></a>        </li>
<li><a name="a4546"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false </span>== <span class="src-var">$schemaTargetNamespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4547"></a>            <span class="src-var">$schemaTargetNamespace </span>= <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a4548"></a>        <span class="src-sym">}</span></li>
<li><a name="a4549"></a>        </li>
<li><a name="a4550"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a> = <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a></span><span class="src-sym">;</span></li>
<li><a name="a4551"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">serviceName </span>= <span class="src-var">$serviceName</span><span class="src-sym">;</span></li>
<li><a name="a4552"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">endpoint </span>= <span class="src-var">$endpoint</span><span class="src-sym">;</span></li>
<li><a name="a4553"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">] </span>= <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a4554"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-str">'soap'</span><span class="src-sym">] </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap/'</span><span class="src-sym">;</span></li>
<li><a name="a4555"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-str">'wsdl'</span><span class="src-sym">] </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/'</span><span class="src-sym">;</span></li>
<li><a name="a4556"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$schemaTargetNamespace </span>!= <span class="src-var">$namespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4557"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">] </span>= <span class="src-var">$schemaTargetNamespace</span><span class="src-sym">;</span></li>
<li><a name="a4558"></a>        <span class="src-sym">}</span></li>
<li><a name="a4559"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">schemas</span><span class="src-sym">[</span><span class="src-var">$schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_xmlschema.html">nusoap_xmlschema</a></span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4560"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$style </span>== <span class="src-str">'document'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4561"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">schemas</span><span class="src-sym">[</span><span class="src-var">$schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">schemaInfo</span><span class="src-sym">[</span><span class="src-str">'elementFormDefault'</span><span class="src-sym">] </span>= <span class="src-str">'qualified'</span><span class="src-sym">;</span></li>
<li><a name="a4562"></a>        <span class="src-sym">}</span></li>
<li><a name="a4563"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">schemas</span><span class="src-sym">[</span><span class="src-var">$schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">schemaTargetNamespace </span>= <span class="src-var">$schemaTargetNamespace</span><span class="src-sym">;</span></li>
<li><a name="a4564"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">schemas</span><span class="src-sym">[</span><span class="src-var">$schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">imports</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4565"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">schemas</span><span class="src-sym">[</span><span class="src-var">$schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">imports</span><span class="src-sym">[</span><span class="src-str">'http://schemas.xmlsoap.org/wsdl/'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4566"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">bindings</span><span class="src-sym">[</span><span class="src-var">$serviceName</span>.<span class="src-str">'Binding'</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a4567"></a>            <span class="src-str">'name'</span>=&gt;<span class="src-var">$serviceName</span>.<span class="src-str">'Binding'</span><span class="src-sym">,</span></li>
<li><a name="a4568"></a>            <span class="src-str">'style'</span>=&gt;<span class="src-var">$style</span><span class="src-sym">,</span></li>
<li><a name="a4569"></a>            <span class="src-str">'transport'</span>=&gt;<span class="src-var">$transport</span><span class="src-sym">,</span></li>
<li><a name="a4570"></a>            <span class="src-str">'portType'</span>=&gt;<span class="src-var">$serviceName</span>.<span class="src-str">'PortType'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4571"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_server.html#var$wsdl">wsdl</a><span class="src-sym">-&gt;</span><span class="src-id">ports</span><span class="src-sym">[</span><span class="src-var">$serviceName</span>.<span class="src-str">'Port'</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a4572"></a>            <span class="src-str">'binding'</span>=&gt;<span class="src-var">$serviceName</span>.<span class="src-str">'Binding'</span><span class="src-sym">,</span></li>
<li><a name="a4573"></a>            <span class="src-str">'location'</span>=&gt;<span class="src-var">$endpoint</span><span class="src-sym">,</span></li>
<li><a name="a4574"></a>            <span class="src-str">'bindingType'</span>=&gt;<span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap/'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4575"></a>    <span class="src-sym">}</span></li>
<li><a name="a4576"></a><span class="src-sym">}</span></li>
<li><a name="a4577"></a>&nbsp;</li>
<li><a name="a4578"></a><span class="src-doc">/**</span></li>
<li><a name="a4579"></a><span class="src-doc"> * Backward compatibility</span></li>
<li><a name="a4580"></a><span class="src-doc"> */</span></li>
<li><a name="a4581"></a><span class="src-key">class </span><a href="../nusoap/soap_server.html">soap_server</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_server.html#methodnusoap_server">nusoap_server</a> <span class="src-sym">{</span></li>
<li><a name="a4582"></a><span class="src-sym">}</span></li>
<li><a name="a4583"></a>&nbsp;</li>
<li><a name="a4584"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a4585"></a>&nbsp;</li>
<li><a name="a4586"></a>&nbsp;</li>
<li><a name="a4587"></a>&nbsp;</li>
<li><a name="a4588"></a><span class="src-doc">/**</span></li>
<li><a name="a4589"></a><span class="src-doc">* parses a WSDL file, allows access to it's data, other utility methods.</span></li>
<li><a name="a4590"></a><span class="src-doc">* also builds WSDL structures programmatically.</span></li>
<li><a name="a4591"></a><span class="src-doc">* </span></li>
<li><a name="a4592"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a4593"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a4594"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a4595"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a4596"></a><span class="src-doc">*/</span></li>
<li><a name="a4597"></a><span class="src-key">class </span><a href="../nusoap/wsdl.html">wsdl</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a4598"></a>    <span class="src-comm">// URL or filename of the root of this WSDL</span></li>
<li><a name="a4598"></a>    </li>
<li><a name="a4599"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$wsdl">$wsdl</a><span class="src-sym">; </span></li>
<li><a name="a4600"></a>    <span class="src-comm">// define internal arrays of bindings, ports, operations, messages, etc.</span></li>
<li><a name="a4600"></a>    </li>
<li><a name="a4601"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$schemas">$schemas</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4602"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentSchema">$currentSchema</a><span class="src-sym">;</span></li>
<li><a name="a4603"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$message">$message</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4604"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$complexTypes">$complexTypes</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4605"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$messages">$messages</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4606"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentMessage">$currentMessage</a><span class="src-sym">;</span></li>
<li><a name="a4607"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentOperation">$currentOperation</a><span class="src-sym">;</span></li>
<li><a name="a4608"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$portTypes">$portTypes</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4609"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentPortType">$currentPortType</a><span class="src-sym">;</span></li>
<li><a name="a4610"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$bindings">$bindings</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4611"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentBinding">$currentBinding</a><span class="src-sym">;</span></li>
<li><a name="a4612"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$ports">$ports</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4613"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$currentPort">$currentPort</a><span class="src-sym">;</span></li>
<li><a name="a4614"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$opData">$opData</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4615"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$status">$status</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4616"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$documentation">$documentation</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4617"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$endpoint">$endpoint</a> = <span class="src-str">''</span><span class="src-sym">; </span></li>
<li><a name="a4618"></a>    <span class="src-comm">// array of wsdl docs to import</span></li>
<li><a name="a4618"></a>    </li>
<li><a name="a4619"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$import">$import</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a4620"></a>    <span class="src-comm">// parser vars</span></li>
<li><a name="a4620"></a>    </li>
<li><a name="a4621"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$parser">$parser</a><span class="src-sym">;</span></li>
<li><a name="a4622"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$position">$position</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a4623"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$depth">$depth</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a4624"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$depth_array">$depth_array</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4625"></a>    <span class="src-comm">// for getting wsdl</span></li>
<li><a name="a4625"></a>    </li>
<li><a name="a4626"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$proxyhost">$proxyhost</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4627"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$proxyport">$proxyport</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4628"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$proxyusername">$proxyusername</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4629"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$proxypassword">$proxypassword</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4630"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$timeout">$timeout</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a4631"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$response_timeout">$response_timeout</a> = <span class="src-num">30</span><span class="src-sym">;</span></li>
<li><a name="a4632"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$curl_options">$curl_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// User-specified cURL options</span></li>
<li><a name="a4632"></a>    </li>
<li><a name="a4633"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$use_curl">$use_curl</a> = <span class="src-id">false</span><span class="src-sym">;            </span><span class="src-comm">// whether to always try to use cURL</span></li>
<li><a name="a4634"></a>    <span class="src-comm">// for HTTP authentication</span></li>
<li><a name="a4634"></a>    </li>
<li><a name="a4635"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$username">$username</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Username for HTTP authentication</span></li>
<li><a name="a4635"></a>    </li>
<li><a name="a4636"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$password">$password</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Password for HTTP authentication</span></li>
<li><a name="a4636"></a>    </li>
<li><a name="a4637"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$authtype">$authtype</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Type of HTTP authentication</span></li>
<li><a name="a4637"></a>    </li>
<li><a name="a4638"></a>    <span class="src-key">var </span><a href="../nusoap/wsdl.html#var$certRequest">$certRequest</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;        </span><span class="src-comm">// Certificate for HTTP SSL authentication</span></li>
<li><a name="a4639"></a>&nbsp;</li>
<li><a name="a4638"></a>    </li>
<li><a name="a4639"></a>&nbsp;</li>
<li><a name="a4640"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4641"></a><span class="src-doc">     * constructor</span></li>
<li><a name="a4642"></a><span class="src-doc">     * </span></li>
<li><a name="a4643"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$wsdl </span><span class="src-doc">WSDL document URL</span></li>
<li><a name="a4644"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyhost </span></li>
<li><a name="a4645"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyport </span></li>
<li><a name="a4646"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyusername </span></li>
<li><a name="a4647"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxypassword </span></li>
<li><a name="a4648"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set the connection timeout</span></li>
<li><a name="a4649"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set the response timeout</span></li>
<li><a name="a4650"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$curl_options </span><span class="src-doc">user-specified cURL options</span></li>
<li><a name="a4651"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$use_curl </span><span class="src-doc">try to use cURL</span></li>
<li><a name="a4652"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a4653"></a><span class="src-doc">     */</span></li>
<li><a name="a4654"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodwsdl">wsdl</a><span class="src-sym">(</span><span class="src-var">$wsdl </span>= <span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$proxyhost</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxyport</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxyusername</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxypassword</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$timeout</span>=<span class="src-num">0</span><span class="src-sym">,</span><span class="src-var">$response_timeout</span>=<span class="src-num">30</span><span class="src-sym">,</span><span class="src-var">$curl_options</span>=<span class="src-id">null</span><span class="src-sym">,</span><span class="src-var">$use_curl</span>=<span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4655"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4656"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">ctor wsdl=<span class="src-var">$wsdl</span> timeout=<span class="src-var">$timeout</span> response_timeout=<span class="src-var">$response_timeout</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4657"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyhost">proxyhost</a> = <span class="src-var">$proxyhost</span><span class="src-sym">;</span></li>
<li><a name="a4658"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyport">proxyport</a> = <span class="src-var">$proxyport</span><span class="src-sym">;</span></li>
<li><a name="a4659"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyusername">proxyusername</a> = <span class="src-var">$proxyusername</span><span class="src-sym">;</span></li>
<li><a name="a4660"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxypassword">proxypassword</a> = <span class="src-var">$proxypassword</span><span class="src-sym">;</span></li>
<li><a name="a4661"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$timeout">timeout</a> = <span class="src-var">$timeout</span><span class="src-sym">;</span></li>
<li><a name="a4662"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$response_timeout">response_timeout</a> = <span class="src-var">$response_timeout</span><span class="src-sym">;</span></li>
<li><a name="a4663"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$curl_options</span><span class="src-sym">))</span></li>
<li><a name="a4664"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$curl_options">curl_options</a> = <span class="src-var">$curl_options</span><span class="src-sym">;</span></li>
<li><a name="a4665"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$use_curl">use_curl</a> = <span class="src-var">$use_curl</span><span class="src-sym">;</span></li>
<li><a name="a4666"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodfetchWSDL">fetchWSDL</a><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4667"></a>    <span class="src-sym">}</span></li>
<li><a name="a4668"></a>&nbsp;</li>
<li><a name="a4669"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4670"></a><span class="src-doc">     * fetches the WSDL document and parses it</span></li>
<li><a name="a4671"></a><span class="src-doc">     *</span></li>
<li><a name="a4672"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a4673"></a><span class="src-doc">     */</span></li>
<li><a name="a4674"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodfetchWSDL">fetchWSDL</a><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4675"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">parse and process WSDL path=<span class="src-var">$wsdl</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4676"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$wsdl">wsdl</a> = <span class="src-var">$wsdl</span><span class="src-sym">;</span></li>
<li><a name="a4677"></a>        <span class="src-comm">// parse wsdl file</span></li>
<li><a name="a4678"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$wsdl">wsdl</a> != <span class="src-str">&quot;&quot;</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4679"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodparseWSDL">parseWSDL</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4680"></a>        <span class="src-sym">}</span></li>
<li><a name="a4681"></a>        <span class="src-comm">// imports</span></li>
<li><a name="a4682"></a>        <span class="src-comm">// TODO: handle imports more properly, grabbing them in-line and nesting them</span></li>
<li><a name="a4683"></a>        <span class="src-var">$imported_urls </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4684"></a>        <span class="src-var">$imported </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a4685"></a>        <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$imported </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4686"></a>            <span class="src-var">$imported </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a4687"></a>            <span class="src-comm">// Schema imports</span></li>
<li><a name="a4688"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$list</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4689"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$list </span><span class="src-key">as </span><span class="src-var">$xs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4690"></a>                    <span class="src-var">$wsdlparts </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// this is bogusly simple!</span></li>
<li><a name="a4691"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$xs</span><span class="src-sym">-&gt;</span><span class="src-id">imports </span><span class="src-key">as </span><span class="src-var">$ns2 </span>=&gt; <span class="src-var">$list2</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4692"></a>                        <span class="src-key">for </span><span class="src-sym">(</span><span class="src-var">$ii </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$ii </span>&lt; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$list2</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-var">$ii</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4693"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$list2</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'loaded'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4694"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">imports</span><span class="src-sym">[</span><span class="src-var">$ns2</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'loaded'</span><span class="src-sym">] </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4695"></a>                                <span class="src-var">$url </span>= <span class="src-var">$list2</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4696"></a>                                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$url </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4697"></a>                                    <span class="src-var">$urlparts </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4698"></a>                                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$urlparts</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4699"></a>                                        <span class="src-var">$url </span>= <span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>. <span class="src-str">'://' </span>. <span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">] </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-str">':' </span>.<span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">) </span>.</li>
<li><a name="a4700"></a>                                                <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-str">'/'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">) </span>.<span class="src-var">$urlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4701"></a>                                    <span class="src-sym">}</span></li>
<li><a name="a4702"></a>                                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$imported_urls</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4703"></a>                                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodparseWSDL">parseWSDL</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4704"></a>                                        <span class="src-var">$imported</span>++<span class="src-sym">;</span></li>
<li><a name="a4705"></a>                                        <span class="src-var">$imported_urls</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$url</span><span class="src-sym">;</span></li>
<li><a name="a4706"></a>                                    <span class="src-sym">}</span></li>
<li><a name="a4707"></a>                                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4708"></a>                                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Unexpected scenario: empty URL for unloaded import&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4709"></a>                                <span class="src-sym">}</span></li>
<li><a name="a4710"></a>                            <span class="src-sym">}</span></li>
<li><a name="a4711"></a>                        <span class="src-sym">}</span></li>
<li><a name="a4712"></a>                    <span class="src-sym">} </span></li>
<li><a name="a4713"></a>                <span class="src-sym">}</span></li>
<li><a name="a4714"></a>            <span class="src-sym">}</span></li>
<li><a name="a4715"></a>            <span class="src-comm">// WSDL imports</span></li>
<li><a name="a4716"></a>            <span class="src-var">$wsdlparts </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$wsdl">wsdl</a><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// this is bogusly simple!</span></li>
<li><a name="a4717"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$list</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4718"></a>                <span class="src-key">for </span><span class="src-sym">(</span><span class="src-var">$ii </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$ii </span>&lt; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-var">$ii</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4719"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$list</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'loaded'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4720"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'loaded'</span><span class="src-sym">] </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4721"></a>                        <span class="src-var">$url </span>= <span class="src-var">$list</span><span class="src-sym">[</span><span class="src-var">$ii</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4722"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$url </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4723"></a>                            <span class="src-var">$urlparts </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4724"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$urlparts</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4725"></a>                                <span class="src-var">$url </span>= <span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>. <span class="src-str">'://' </span>. <span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">] </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-str">':' </span>. <span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">) </span>.</li>
<li><a name="a4726"></a>                                        <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$wsdlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-str">'/'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">) </span>.<span class="src-var">$urlparts</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4727"></a>                            <span class="src-sym">}</span></li>
<li><a name="a4728"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$imported_urls</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4729"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodparseWSDL">parseWSDL</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4730"></a>                                <span class="src-var">$imported</span>++<span class="src-sym">;</span></li>
<li><a name="a4731"></a>                                <span class="src-var">$imported_urls</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$url</span><span class="src-sym">;</span></li>
<li><a name="a4732"></a>                            <span class="src-sym">}</span></li>
<li><a name="a4733"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4734"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Unexpected scenario: empty URL for unloaded import&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4735"></a>                        <span class="src-sym">}</span></li>
<li><a name="a4736"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4737"></a>                <span class="src-sym">}</span></li>
<li><a name="a4738"></a>            <span class="src-sym">} </span></li>
<li><a name="a4739"></a>        <span class="src-sym">}</span></li>
<li><a name="a4740"></a>        <span class="src-comm">// add new data to operation data</span></li>
<li><a name="a4741"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a> <span class="src-key">as </span><span class="src-var">$binding </span>=&gt; <span class="src-var">$bindingData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4742"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4743"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$operation </span>=&gt; <span class="src-var">$data</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4744"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'post-parse data gathering for ' </span>. <span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4745"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">] </span>= </li>
<li><a name="a4746"></a>                        isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">) </span>? </li>
<li><a name="a4747"></a>                        <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">) </span>:</li>
<li><a name="a4748"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4749"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">] </span>= </li>
<li><a name="a4750"></a>                        isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">) </span>?</li>
<li><a name="a4751"></a>                        <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">) </span>:</li>
<li><a name="a4752"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4753"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] ]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4754"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] ]</span><span class="src-sym">;</span></li>
<li><a name="a4755"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4756"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] ]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4757"></a>                           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] ]</span><span class="src-sym">;</span></li>
<li><a name="a4758"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4759"></a>                    <span class="src-comm">// Set operation style if necessary, but do not override one already provided</span></li>
<li><a name="a4760"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4761"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">] </span>= <span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4762"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4763"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'transport'</span><span class="src-sym">] </span>= isset<span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'transport'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'transport'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4764"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">] </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[ </span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4765"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">] </span>= isset<span class="src-sym">(</span><span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$bindingData</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4766"></a>                <span class="src-sym">} </span></li>
<li><a name="a4767"></a>            <span class="src-sym">} </span></li>
<li><a name="a4768"></a>        <span class="src-sym">}</span></li>
<li><a name="a4769"></a>    <span class="src-sym">}</span></li>
<li><a name="a4770"></a>&nbsp;</li>
<li><a name="a4771"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4772"></a><span class="src-doc">     * parses the wsdl document</span></li>
<li><a name="a4773"></a><span class="src-doc">     * </span></li>
<li><a name="a4774"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$wsdl </span><span class="src-doc">path or URL</span></li>
<li><a name="a4775"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a4776"></a><span class="src-doc">     */</span></li>
<li><a name="a4777"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodparseWSDL">parseWSDL</a><span class="src-sym">(</span><span class="src-var">$wsdl </span>= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4778"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">parse WSDL at path=<span class="src-var">$wsdl</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4779"></a>&nbsp;</li>
<li><a name="a4780"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$wsdl </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4781"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no wsdl passed to parseWSDL()!!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4782"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no wsdl passed to parseWSDL()!!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4783"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4784"></a>        <span class="src-sym">}</span></li>
<li><a name="a4785"></a>        </li>
<li><a name="a4786"></a>        <span class="src-comm">// parse $wsdl for url format</span></li>
<li><a name="a4787"></a>        <span class="src-var">$wsdl_props </span>= <a href="http://www.php.net/parse_url">parse_url</a><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4788"></a>&nbsp;</li>
<li><a name="a4789"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>== <span class="src-str">'http' </span>|| <span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>== <span class="src-str">'https'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4790"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'getting WSDL http(s) URL ' </span>. <span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4791"></a>            <span class="src-comm">// get wsdl</span></li>
<li><a name="a4792"></a>            <span class="src-var">$tr </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/soap_transport_http.html">soap_transport_http</a></span><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$curl_options">curl_options</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$use_curl">use_curl</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4793"></a>            <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">request_method </span>= <span class="src-str">'GET'</span><span class="src-sym">;</span></li>
<li><a name="a4794"></a>            <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">useSOAPAction </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4795"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyhost">proxyhost</a> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyport">proxyport</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a4796"></a>                <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">setProxy</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyhost">proxyhost</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyport">proxyport</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxyusername">proxyusername</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$proxypassword">proxypassword</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4797"></a>            <span class="src-sym">}</span></li>
<li><a name="a4798"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$authtype">authtype</a> != <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4799"></a>                <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">setCredentials</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$username">username</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$password">password</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$authtype">authtype</a><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$certRequest">certRequest</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4800"></a>            <span class="src-sym">}</span></li>
<li><a name="a4801"></a>            <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">setEncoding</span><span class="src-sym">(</span><span class="src-str">'gzip, deflate'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4802"></a>            <span class="src-var">$wsdl_string </span>= <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">send</span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$timeout">timeout</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$response_timeout">response_timeout</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4803"></a>            <span class="src-comm">//$this-&gt;debug(&quot;WSDL request\n&quot; . $tr-&gt;outgoing_payload);</span></li>
<li><a name="a4804"></a>            <span class="src-comm">//$this-&gt;debug(&quot;WSDL response\n&quot; . $tr-&gt;incoming_payload);</span></li>
<li><a name="a4805"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4806"></a>            <span class="src-comm">// catch errors</span></li>
<li><a name="a4807"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$err </span>= <span class="src-var">$tr</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">) )</span><span class="src-sym">{</span></li>
<li><a name="a4808"></a>                <span class="src-var">$errstr </span>= <span class="src-str">'Getting ' </span>. <span class="src-var">$wsdl </span>. <span class="src-str">' - HTTP ERROR: '</span>.<span class="src-var">$err</span><span class="src-sym">;</span></li>
<li><a name="a4809"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4810"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4811"></a>                unset<span class="src-sym">(</span><span class="src-var">$tr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4812"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4813"></a>            <span class="src-sym">}</span></li>
<li><a name="a4814"></a>            unset<span class="src-sym">(</span><span class="src-var">$tr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4815"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;got WSDL URL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4816"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4817"></a>            <span class="src-comm">// $wsdl is not http(s), so treat it as a file URL or plain file path</span></li>
<li><a name="a4818"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'scheme'</span><span class="src-sym">] </span>== <span class="src-str">'file'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4819"></a>                <span class="src-var">$path </span>= isset<span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-sym">(</span><span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">] </span>. <span class="src-str">':' </span>. <span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">) </span>: <span class="src-var">$wsdl_props</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4820"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4821"></a>                <span class="src-var">$path </span>= <span class="src-var">$wsdl</span><span class="src-sym">;</span></li>
<li><a name="a4822"></a>            <span class="src-sym">}</span></li>
<li><a name="a4823"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'getting WSDL file ' </span>. <span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4824"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$fp </span>= <span class="src-sym">@</span><a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">, </span><span class="src-str">'r'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4825"></a>                <span class="src-var">$wsdl_string </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4826"></a>                <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$data </span>= <a href="http://www.php.net/fread">fread</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">, </span><span class="src-num">32768</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4827"></a>                    <span class="src-var">$wsdl_string </span>.= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a4828"></a>                <span class="src-sym">} </span></li>
<li><a name="a4829"></a>                <a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4830"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4831"></a>                <span class="src-var">$errstr </span>= <span class="src-str">&quot;</span><span class="src-str">Bad path to WSDL file <span class="src-var">$path</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a4832"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4833"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4834"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4835"></a>            <span class="src-sym">} </span></li>
<li><a name="a4836"></a>        <span class="src-sym">}</span></li>
<li><a name="a4837"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Parse WSDL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4838"></a>        <span class="src-comm">// end new code added</span></li>
<li><a name="a4839"></a>        <span class="src-comm">// Create an XML parser.</span></li>
<li><a name="a4840"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a> = <a href="http://www.php.net/xml_parser_create">xml_parser_create</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a4841"></a>        <span class="src-comm">// Set the options for parsing the XML data.</span></li>
<li><a name="a4842"></a>        <span class="src-comm">// xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);</span></li>
<li><a name="a4843"></a>        <a href="http://www.php.net/xml_parser_set_option">xml_parser_set_option</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-id">XML_OPTION_CASE_FOLDING</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a4844"></a>        <span class="src-comm">// Set the object for the parser.</span></li>
<li><a name="a4845"></a>        <a href="http://www.php.net/xml_set_object">xml_set_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a4846"></a>        <span class="src-comm">// Set the element handlers for the parser.</span></li>
<li><a name="a4847"></a>        <a href="http://www.php.net/xml_set_element_handler">xml_set_element_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-str">'start_element'</span><span class="src-sym">, </span><span class="src-str">'end_element'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4848"></a>        <a href="http://www.php.net/xml_set_character_data_handler">xml_set_character_data_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-str">'character_data'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4849"></a>        <span class="src-comm">// Parse the XML file.</span></li>
<li><a name="a4850"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/xml_parse">xml_parse</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">, </span><span class="src-var">$wsdl_string</span><span class="src-sym">, </span><span class="src-id">true</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4851"></a>            <span class="src-comm">// Display an error message.</span></li>
<li><a name="a4852"></a>            <span class="src-var">$errstr </span>= <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span></li>
<li><a name="a4853"></a>                <span class="src-str">'XML error parsing WSDL from %s on line %d: %s'</span><span class="src-sym">,</span></li>
<li><a name="a4854"></a>                <span class="src-var">$wsdl</span><span class="src-sym">,</span></li>
<li><a name="a4855"></a>                <a href="http://www.php.net/xml_get_current_line_number">xml_get_current_line_number</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a4856"></a>                <a href="http://www.php.net/xml_error_string">xml_error_string</a><span class="src-sym">(</span><a href="http://www.php.net/xml_get_error_code">xml_get_error_code</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">))</span></li>
<li><a name="a4857"></a>                <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4858"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4859"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;XML payload:\n&quot; </span>. <span class="src-var">$wsdl_string</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4860"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4861"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4862"></a>        <span class="src-sym">} </span></li>
<li><a name="a4863"></a>        <span class="src-comm">// free the parser</span></li>
<li><a name="a4864"></a>        <a href="http://www.php.net/xml_parser_free">xml_parser_free</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$parser">parser</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4865"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Parsing WSDL done'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4866"></a>        <span class="src-comm">// catch wsdl parse errors</span></li>
<li><a name="a4867"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a4868"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a4869"></a>        <span class="src-sym">}</span></li>
<li><a name="a4870"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4871"></a>    <span class="src-sym">} </span></li>
<li><a name="a4872"></a>&nbsp;</li>
<li><a name="a4873"></a>    <span class="src-doc">/**</span></li>
<li><a name="a4874"></a><span class="src-doc">     * start-element handler</span></li>
<li><a name="a4875"></a><span class="src-doc">     * </span></li>
<li><a name="a4876"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a4877"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a4878"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$attrs </span><span class="src-doc">associative array of attributes</span></li>
<li><a name="a4879"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a4880"></a><span class="src-doc">     */</span></li>
<li><a name="a4881"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodstart_element">start_element</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">)</span></li>
<li><a name="a4882"></a>    <span class="src-sym">{</span></li>
<li><a name="a4883"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> == <span class="src-str">'schema'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4884"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">schemaStartElement</span><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4885"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4886"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4887"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/schema$/'</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4888"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Parsing WSDL schema'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4889"></a>            <span class="src-comm">// $this-&gt;debug(&quot;startElement for $name ($attrs[name]). status = $this-&gt;status (&quot;.$this-&gt;getLocalPart($name).&quot;)&quot;);</span></li>
<li><a name="a4890"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">'schema'</span><span class="src-sym">;</span></li>
<li><a name="a4891"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a> = <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_xmlschema.html">nusoap_xmlschema</a></span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4892"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">schemaStartElement</span><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4893"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4894"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4895"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4896"></a>            <span class="src-comm">// position in the total number of elements, starting from 0</span></li>
<li><a name="a4897"></a>            <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$position">position</a>++<span class="src-sym">;</span></li>
<li><a name="a4898"></a>            <span class="src-var">$depth </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth">depth</a>++<span class="src-sym">; </span></li>
<li><a name="a4899"></a>            <span class="src-comm">// set self as current value for this depth</span></li>
<li><a name="a4900"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$depth</span><span class="src-sym">] </span>= <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a4901"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cdata' </span>=&gt; <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a4902"></a>            <span class="src-comm">// process attributes</span></li>
<li><a name="a4903"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4904"></a>                <span class="src-comm">// register namespace declarations</span></li>
<li><a name="a4905"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4906"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^xmlns/'</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4907"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ns_prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strrchr">strrchr</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4908"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$ns_prefix</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a4909"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4910"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'ns' </span>. <span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a4911"></a>                        <span class="src-sym">} </span></li>
<li><a name="a4912"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/2001/XMLSchema' </span>|| <span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/1999/XMLSchema' </span>|| <span class="src-var">$v </span>== <span class="src-str">'http://www.w3.org/2000/10/XMLSchema'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4913"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a> = <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a4914"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsi'</span><span class="src-sym">] </span>= <span class="src-var">$v </span>. <span class="src-str">'-instance'</span><span class="src-sym">;</span></li>
<li><a name="a4915"></a>                        <span class="src-sym">} </span></li>
<li><a name="a4916"></a>                    <span class="src-sym">}</span></li>
<li><a name="a4917"></a>                <span class="src-sym">}</span></li>
<li><a name="a4918"></a>                <span class="src-comm">// expand each attribute prefix to its namespace</span></li>
<li><a name="a4919"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4920"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">) </span>: <span class="src-var">$k</span><span class="src-sym">;</span></li>
<li><a name="a4921"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$k </span>!= <span class="src-str">'location' </span>&amp;&amp; <span class="src-var">$k </span>!= <span class="src-str">'soapAction' </span>&amp;&amp; <span class="src-var">$k </span>!= <span class="src-str">'namespace'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4922"></a>                        <span class="src-var">$v </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>: <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a4923"></a>                    <span class="src-sym">} </span></li>
<li><a name="a4924"></a>                    <span class="src-var">$eAttrs</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a4925"></a>                <span class="src-sym">} </span></li>
<li><a name="a4926"></a>                <span class="src-var">$attrs </span>= <span class="src-var">$eAttrs</span><span class="src-sym">;</span></li>
<li><a name="a4927"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a4928"></a>                <span class="src-var">$attrs </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4929"></a>            <span class="src-sym">} </span></li>
<li><a name="a4930"></a>            <span class="src-comm">// get element prefix, namespace and name</span></li>
<li><a name="a4931"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/:/'</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4932"></a>                <span class="src-comm">// get ns prefix</span></li>
<li><a name="a4933"></a>                <span class="src-var">$prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">; </span></li>
<li><a name="a4934"></a>                <span class="src-comm">// get ns</span></li>
<li><a name="a4935"></a>                <span class="src-var">$namespace </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">; </span></li>
<li><a name="a4936"></a>                <span class="src-comm">// get unqualified name</span></li>
<li><a name="a4937"></a>                <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4938"></a>            <span class="src-sym">} </span></li>
<li><a name="a4939"></a>            <span class="src-comm">// process attributes, expanding any prefixes to namespaces</span></li>
<li><a name="a4940"></a>            <span class="src-comm">// find status, register data</span></li>
<li><a name="a4941"></a>            <span class="src-key">switch </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4942"></a>                <span class="src-key">case </span><span class="src-str">'message'</span>:</li>
<li><a name="a4943"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'part'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4944"></a>                        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4945"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;msg &quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentMessage">currentMessage</a> . <span class="src-str">&quot;</span><span class="src-str">: found part (with type) <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-id">name</span><span class="src-sym">]</span>: </span><span class="src-str">&quot; </span>. <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4946"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentMessage">currentMessage</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4947"></a>                        <span class="src-sym">} </span></li>
<li><a name="a4948"></a>                        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'element'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4949"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;msg &quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentMessage">currentMessage</a> . <span class="src-str">&quot;</span><span class="src-str">: found part (with element) <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-id">name</span><span class="src-sym">]</span>: </span><span class="src-str">&quot; </span>. <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a4950"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentMessage">currentMessage</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'element'</span><span class="src-sym">] </span>. <span class="src-str">'^'</span><span class="src-sym">;</span></li>
<li><a name="a4951"></a>                        <span class="src-sym">} </span></li>
<li><a name="a4952"></a>                    <span class="src-sym">} </span></li>
<li><a name="a4953"></a>                    <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4954"></a>                <span class="src-key">case </span><span class="src-str">'portType'</span>:</li>
<li><a name="a4955"></a>                    <span class="src-key">switch </span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4956"></a>                        <span class="src-key">case </span><span class="src-str">'operation'</span>:</li>
<li><a name="a4957"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">currentPortOperation </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4958"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">portType <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPortType">currentPortType</a> operation: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">currentPortOperation</span><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4959"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'parameterOrder'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4960"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPortType">currentPortType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-str">'parameterOrder'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'parameterOrder'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4961"></a>                            <span class="src-sym">} </span></li>
<li><a name="a4962"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4963"></a>                        <span class="src-key">case </span><span class="src-str">'documentation'</span>:</li>
<li><a name="a4964"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$documentation">documentation</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a4965"></a>                            <span class="src-key">break</span><span class="src-sym">; </span></li>
<li><a name="a4966"></a>                        <span class="src-comm">// merge input/output data</span></li>
<li><a name="a4967"></a>                        <span class="src-key">default</span>:</li>
<li><a name="a4968"></a>                            <span class="src-var">$m </span>= isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">]</span><span class="src-sym">) </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4969"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPortType">currentPortType</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">currentPortOperation</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] </span>= <span class="src-var">$m</span><span class="src-sym">;</span></li>
<li><a name="a4970"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4971"></a>                    <span class="src-sym">} </span></li>
<li><a name="a4972"></a>                    <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4973"></a>                <span class="src-key">case </span><span class="src-str">'binding'</span>:</li>
<li><a name="a4974"></a>                    <span class="src-key">switch </span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a4975"></a>                        <span class="src-key">case </span><span class="src-str">'binding'</span>: </li>
<li><a name="a4976"></a>                            <span class="src-comm">// get ns prefix</span></li>
<li><a name="a4977"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4978"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'prefix'</span><span class="src-sym">] </span>= <span class="src-var">$prefix</span><span class="src-sym">;</span></li>
<li><a name="a4979"></a>                            <span class="src-sym">} </span></li>
<li><a name="a4980"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">] </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4981"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4982"></a>                        <span class="src-key">case </span><span class="src-str">'header'</span>:</li>
<li><a name="a4983"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'headers'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a4984"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a4985"></a>                        <span class="src-key">case </span><span class="src-str">'operation'</span>:</li>
<li><a name="a4986"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4987"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4988"></a>                            <span class="src-sym">} </span></li>
<li><a name="a4989"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4990"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4991"></a>                            <span class="src-sym">} </span></li>
<li><a name="a4992"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a4993"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4994"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">current binding operation: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4995"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a4996"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">;</span></li>
<li><a name="a4997"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">] </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a4998"></a>                            <span class="src-sym">} </span></li>
<li><a name="a4999"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5000"></a>                        <span class="src-key">case </span><span class="src-str">'input'</span>:</li>
<li><a name="a5001"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus </span>= <span class="src-str">'input'</span><span class="src-sym">;</span></li>
<li><a name="a5002"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5003"></a>                        <span class="src-key">case </span><span class="src-str">'output'</span>:</li>
<li><a name="a5004"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus </span>= <span class="src-str">'output'</span><span class="src-sym">;</span></li>
<li><a name="a5005"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5006"></a>                        <span class="src-key">case </span><span class="src-str">'body'</span>:</li>
<li><a name="a5007"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5008"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus</span><span class="src-sym">] </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5009"></a>                            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5010"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentOperation">currentOperation</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opStatus</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a5011"></a>                            <span class="src-sym">} </span></li>
<li><a name="a5012"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5013"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5014"></a>                    <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5015"></a>                <span class="src-key">case </span><span class="src-str">'service'</span>:</li>
<li><a name="a5016"></a>                    <span class="src-key">switch </span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5017"></a>                        <span class="src-key">case </span><span class="src-str">'port'</span>:</li>
<li><a name="a5018"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5019"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'current port: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5020"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5021"></a>                    </li>
<li><a name="a5022"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5023"></a>                        <span class="src-key">case </span><span class="src-str">'address'</span>:</li>
<li><a name="a5024"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5025"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">] </span>= <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a5026"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">] </span>= <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a5027"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPort">currentPort</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5028"></a>                            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5029"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5030"></a>                    <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5031"></a>            <span class="src-sym">} </span></li>
<li><a name="a5032"></a>        <span class="src-comm">// set status</span></li>
<li><a name="a5033"></a>        <span class="src-key">switch </span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5034"></a>            <span class="src-key">case </span><span class="src-str">'import'</span>:</li>
<li><a name="a5035"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5036"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5037"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'parsing import ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span>. <span class="src-str">' - ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>. <span class="src-str">' (' </span>. <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">)</span>.<span class="src-str">')'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5038"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5039"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'location' </span>=&gt; <span class="src-str">''</span><span class="src-sym">, </span><span class="src-str">'loaded' </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5040"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5041"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'ns'</span>.<span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">)</span>+<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5042"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5043"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'parsing import ' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span>. <span class="src-str">' - [no location] (' </span>. <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]]</span><span class="src-sym">)</span>.<span class="src-str">')'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5044"></a>                <span class="src-sym">}</span></li>
<li><a name="a5045"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5046"></a>            <span class="src-comm">//wait for schema</span></li>
<li><a name="a5047"></a>            <span class="src-comm">//case 'types':</span></li>
<li><a name="a5048"></a>            <span class="src-comm">//    $this-&gt;status = 'schema';</span></li>
<li><a name="a5049"></a>            <span class="src-comm">//    break;</span></li>
<li><a name="a5050"></a>            <span class="src-key">case </span><span class="src-str">'message'</span>:</li>
<li><a name="a5051"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">'message'</span><span class="src-sym">;</span></li>
<li><a name="a5052"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5053"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentMessage">currentMessage</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5054"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5055"></a>            <span class="src-key">case </span><span class="src-str">'portType'</span>:</li>
<li><a name="a5056"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">'portType'</span><span class="src-sym">;</span></li>
<li><a name="a5057"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$portTypes">portTypes</a><span class="src-sym">[</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5058"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentPortType">currentPortType</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5059"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5060"></a>            <span class="src-key">case </span><span class="src-str">&quot;binding&quot;</span>:</li>
<li><a name="a5061"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5062"></a>                <span class="src-comm">// get binding name</span></li>
<li><a name="a5063"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5064"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5065"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5066"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a> = <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5067"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5068"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">'binding'</span><span class="src-sym">;</span></li>
<li><a name="a5069"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5070"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">current binding: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentBinding">currentBinding</a> of portType: </span><span class="src-str">&quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5071"></a>                <span class="src-sym">} </span></li>
<li><a name="a5072"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5073"></a>            <span class="src-key">case </span><span class="src-str">'service'</span>:</li>
<li><a name="a5074"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5075"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">'service'</span><span class="src-sym">;</span></li>
<li><a name="a5076"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'current service: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5077"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5078"></a>            <span class="src-key">case </span><span class="src-str">'definitions'</span>:</li>
<li><a name="a5079"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$name </span>=&gt; <span class="src-var">$value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5080"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl_info</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a5081"></a>                <span class="src-sym">} </span></li>
<li><a name="a5082"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5083"></a>            <span class="src-sym">} </span></li>
<li><a name="a5084"></a>        <span class="src-sym">} </span></li>
<li><a name="a5085"></a>    <span class="src-sym">} </span></li>
<li><a name="a5086"></a>&nbsp;</li>
<li><a name="a5087"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5088"></a><span class="src-doc">    * end-element handler</span></li>
<li><a name="a5089"></a><span class="src-doc">    * </span></li>
<li><a name="a5090"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a5091"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a5092"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a5093"></a><span class="src-doc">    */</span></li>
<li><a name="a5094"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodend_element">end_element</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">{ </span></li>
<li><a name="a5095"></a>        <span class="src-comm">// unset schema status</span></li>
<li><a name="a5096"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-comm">/*preg_match('/types$/', $name) ||*/ </span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/schema$/'</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5097"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> = <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5098"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5099"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5100"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">schemaTargetNamespace</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">;</span></li>
<li><a name="a5101"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Parsing WSDL schema done'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5102"></a>        <span class="src-sym">} </span></li>
<li><a name="a5103"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$status">status</a> == <span class="src-str">'schema'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5104"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$currentSchema">currentSchema</a><span class="src-sym">-&gt;</span><span class="src-id">schemaEndElement</span><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5105"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5106"></a>            <span class="src-comm">// bring depth down a notch</span></li>
<li><a name="a5107"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth">depth</a>--<span class="src-sym">;</span></li>
<li><a name="a5108"></a>        <span class="src-sym">} </span></li>
<li><a name="a5109"></a>        <span class="src-comm">// end documentation</span></li>
<li><a name="a5110"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$documentation">documentation</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5111"></a>            <span class="src-comm">//TODO: track the node to which documentation should be assigned; it can be a part, message, etc.</span></li>
<li><a name="a5112"></a>            <span class="src-comm">//$this-&gt;portTypes[$this-&gt;currentPortType][$this-&gt;currentPortOperation]['documentation'] = $this-&gt;documentation;</span></li>
<li><a name="a5113"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$documentation">documentation</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5114"></a>        <span class="src-sym">} </span></li>
<li><a name="a5115"></a>    <span class="src-sym">} </span></li>
<li><a name="a5116"></a>&nbsp;</li>
<li><a name="a5117"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5118"></a><span class="src-doc">     * element content handler</span></li>
<li><a name="a5119"></a><span class="src-doc">     * </span></li>
<li><a name="a5120"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a5121"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">element content</span></li>
<li><a name="a5122"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a5123"></a><span class="src-doc">     */</span></li>
<li><a name="a5124"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodcharacter_data">character_data</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span></li>
<li><a name="a5125"></a>    <span class="src-sym">{</span></li>
<li><a name="a5126"></a>        <span class="src-var">$pos </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth">depth</a><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$depth">depth</a><span class="src-sym">] </span>: <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a5127"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5128"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">] </span>.= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a5129"></a>        <span class="src-sym">} </span></li>
<li><a name="a5130"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$documentation">documentation</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5131"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$documentation">documentation</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a5132"></a>        <span class="src-sym">} </span></li>
<li><a name="a5133"></a>    <span class="src-sym">} </span></li>
<li><a name="a5134"></a>&nbsp;</li>
<li><a name="a5135"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5136"></a><span class="src-doc">    * if authenticating, set user credentials here</span></li>
<li><a name="a5137"></a><span class="src-doc">    *</span></li>
<li><a name="a5138"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$username </span></li>
<li><a name="a5139"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$password </span></li>
<li><a name="a5140"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$authtype </span><span class="src-doc">(basic|digest|certificate|ntlm)</span></li>
<li><a name="a5141"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$certRequest </span><span class="src-doc">(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)</span></li>
<li><a name="a5142"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a5143"></a><span class="src-doc">    */</span></li>
<li><a name="a5144"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodsetCredentials">setCredentials</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">, </span><span class="src-var">$password</span><span class="src-sym">, </span><span class="src-var">$authtype </span>= <span class="src-str">'basic'</span><span class="src-sym">, </span><span class="src-var">$certRequest </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5145"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setCredentials username=<span class="src-var">$username</span> authtype=<span class="src-var">$authtype</span> certRequest=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5146"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$certRequest</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5147"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$username">username</a> = <span class="src-var">$username</span><span class="src-sym">;</span></li>
<li><a name="a5148"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$password">password</a> = <span class="src-var">$password</span><span class="src-sym">;</span></li>
<li><a name="a5149"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$authtype">authtype</a> = <span class="src-var">$authtype</span><span class="src-sym">;</span></li>
<li><a name="a5150"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$certRequest">certRequest</a> = <span class="src-var">$certRequest</span><span class="src-sym">;</span></li>
<li><a name="a5151"></a>    <span class="src-sym">}</span></li>
<li><a name="a5152"></a>    </li>
<li><a name="a5153"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodgetBindingData">getBindingData</a><span class="src-sym">(</span><span class="src-var">$binding</span><span class="src-sym">)</span></li>
<li><a name="a5154"></a>    <span class="src-sym">{</span></li>
<li><a name="a5155"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5156"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[</span><span class="src-var">$binding</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5157"></a>        <span class="src-sym">} </span></li>
<li><a name="a5158"></a>    <span class="src-sym">}</span></li>
<li><a name="a5159"></a>    </li>
<li><a name="a5160"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5161"></a><span class="src-doc">     * returns an assoc array of operation names =&gt; operation data</span></li>
<li><a name="a5162"></a><span class="src-doc">     * </span></li>
<li><a name="a5163"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$portName </span><span class="src-doc">WSDL port name</span></li>
<li><a name="a5164"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$bindingType </span><span class="src-doc">eg: soap, smtp, dime (only soap and soap12 are currently supported)</span></li>
<li><a name="a5165"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">array </span></li>
<li><a name="a5166"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5167"></a><span class="src-doc">     */</span></li>
<li><a name="a5168"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodgetOperations">getOperations</a><span class="src-sym">(</span><span class="src-var">$portName </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$bindingType </span>= <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5169"></a>        <span class="src-var">$ops </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5170"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5171"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap/'</span><span class="src-sym">;</span></li>
<li><a name="a5172"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap12'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5173"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap12/'</span><span class="src-sym">;</span></li>
<li><a name="a5174"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5175"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">getOperations bindingType <span class="src-var">$bindingType</span> may not be supported</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5176"></a>        <span class="src-sym">}</span></li>
<li><a name="a5177"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">getOperations for port '<span class="src-var">$portName</span>' bindingType <span class="src-var">$bindingType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5178"></a>        <span class="src-comm">// loop thru ports</span></li>
<li><a name="a5179"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a> <span class="src-key">as </span><span class="src-var">$port </span>=&gt; <span class="src-var">$portData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5180"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">getOperations checking port <span class="src-var">$port</span> bindingType </span><span class="src-str">&quot; </span>. <span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5181"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$portName </span>== <span class="src-str">'' </span>|| <span class="src-var">$port </span>== <span class="src-var">$portName</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5182"></a>                <span class="src-comm">// binding type of port matches parameter</span></li>
<li><a name="a5183"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">] </span>== <span class="src-var">$bindingType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5184"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">getOperations found port <span class="src-var">$port</span> bindingType <span class="src-var">$bindingType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5185"></a>                    <span class="src-comm">//$this-&gt;debug(&quot;port data: &quot; . $this-&gt;varDump($portData));</span></li>
<li><a name="a5186"></a>                    <span class="src-comm">//$this-&gt;debug(&quot;bindings: &quot; . $this-&gt;varDump($this-&gt;bindings[ $portData['binding'] ]));</span></li>
<li><a name="a5187"></a>                    <span class="src-comm">// merge bindings</span></li>
<li><a name="a5188"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5189"></a>                        <span class="src-var">$ops </span>= <a href="http://www.php.net/array_merge">array_merge</a> <span class="src-sym">(</span><span class="src-var">$ops</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5190"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5191"></a>                <span class="src-sym">}</span></li>
<li><a name="a5192"></a>            <span class="src-sym">}</span></li>
<li><a name="a5193"></a>        <span class="src-sym">}</span></li>
<li><a name="a5194"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$ops</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5195"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">getOperations found no operations for port '<span class="src-var">$portName</span>' bindingType <span class="src-var">$bindingType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5196"></a>        <span class="src-sym">}</span></li>
<li><a name="a5197"></a>        <span class="src-key">return </span><span class="src-var">$ops</span><span class="src-sym">;</span></li>
<li><a name="a5198"></a>    <span class="src-sym">} </span></li>
<li><a name="a5199"></a>    </li>
<li><a name="a5200"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5201"></a><span class="src-doc">     * returns an associative array of data necessary for calling an operation</span></li>
<li><a name="a5202"></a><span class="src-doc">     * </span></li>
<li><a name="a5203"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$operation </span><span class="src-doc">name of operation</span></li>
<li><a name="a5204"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$bindingType </span><span class="src-doc">type of binding eg: soap, soap12</span></li>
<li><a name="a5205"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">array </span></li>
<li><a name="a5206"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5207"></a><span class="src-doc">     */</span></li>
<li><a name="a5208"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodgetOperationData">getOperationData</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">, </span><span class="src-var">$bindingType </span>= <span class="src-str">'soap'</span><span class="src-sym">)</span></li>
<li><a name="a5209"></a>    <span class="src-sym">{</span></li>
<li><a name="a5210"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5211"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap/'</span><span class="src-sym">;</span></li>
<li><a name="a5212"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap12'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5213"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap12/'</span><span class="src-sym">;</span></li>
<li><a name="a5214"></a>        <span class="src-sym">}</span></li>
<li><a name="a5215"></a>        <span class="src-comm">// loop thru ports</span></li>
<li><a name="a5216"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a> <span class="src-key">as </span><span class="src-var">$port </span>=&gt; <span class="src-var">$portData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5217"></a>            <span class="src-comm">// binding type of port matches parameter</span></li>
<li><a name="a5218"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">] </span>== <span class="src-var">$bindingType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5219"></a>                <span class="src-comm">// get binding</span></li>
<li><a name="a5220"></a>                <span class="src-comm">//foreach($this-&gt;bindings[ $portData['binding'] ]['operations'] as $bOperation =&gt; $opData) {</span></li>
<li><a name="a5221"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$bOperation</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5222"></a>                    <span class="src-comm">// note that we could/should also check the namespace here</span></li>
<li><a name="a5223"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$operation </span>== <span class="src-var">$bOperation</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5224"></a>                        <span class="src-var">$opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5225"></a>                        <span class="src-key">return </span><span class="src-var">$opData</span><span class="src-sym">;</span></li>
<li><a name="a5226"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5227"></a>                <span class="src-sym">} </span></li>
<li><a name="a5228"></a>            <span class="src-sym">}</span></li>
<li><a name="a5229"></a>        <span class="src-sym">} </span></li>
<li><a name="a5230"></a>    <span class="src-sym">}</span></li>
<li><a name="a5231"></a>    </li>
<li><a name="a5232"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5233"></a><span class="src-doc">     * returns an associative array of data necessary for calling an operation</span></li>
<li><a name="a5234"></a><span class="src-doc">     * </span></li>
<li><a name="a5235"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapAction </span><span class="src-doc">soapAction for operation</span></li>
<li><a name="a5236"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$bindingType </span><span class="src-doc">type of binding eg: soap, soap12</span></li>
<li><a name="a5237"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">array </span></li>
<li><a name="a5238"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5239"></a><span class="src-doc">     */</span></li>
<li><a name="a5240"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodgetOperationDataForSoapAction">getOperationDataForSoapAction</a><span class="src-sym">(</span><span class="src-var">$soapAction</span><span class="src-sym">, </span><span class="src-var">$bindingType </span>= <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5241"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5242"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap/'</span><span class="src-sym">;</span></li>
<li><a name="a5243"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$bindingType </span>== <span class="src-str">'soap12'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5244"></a>            <span class="src-var">$bindingType </span>= <span class="src-str">'http://schemas.xmlsoap.org/wsdl/soap12/'</span><span class="src-sym">;</span></li>
<li><a name="a5245"></a>        <span class="src-sym">}</span></li>
<li><a name="a5246"></a>        <span class="src-comm">// loop thru ports</span></li>
<li><a name="a5247"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a> <span class="src-key">as </span><span class="src-var">$port </span>=&gt; <span class="src-var">$portData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5248"></a>            <span class="src-comm">// binding type of port matches parameter</span></li>
<li><a name="a5249"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'bindingType'</span><span class="src-sym">] </span>== <span class="src-var">$bindingType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5250"></a>                <span class="src-comm">// loop through operations for the binding</span></li>
<li><a name="a5251"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$portData</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] ]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$bOperation </span>=&gt; <span class="src-var">$opData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5252"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">] </span>== <span class="src-var">$soapAction</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5253"></a>                        <span class="src-key">return </span><span class="src-var">$opData</span><span class="src-sym">;</span></li>
<li><a name="a5254"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5255"></a>                <span class="src-sym">} </span></li>
<li><a name="a5256"></a>            <span class="src-sym">}</span></li>
<li><a name="a5257"></a>        <span class="src-sym">} </span></li>
<li><a name="a5258"></a>    <span class="src-sym">}</span></li>
<li><a name="a5259"></a>    </li>
<li><a name="a5260"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5261"></a><span class="src-doc">    * returns an array of information about a given type</span></li>
<li><a name="a5262"></a><span class="src-doc">    * returns false if no type exists by the given name</span></li>
<li><a name="a5263"></a><span class="src-doc">    *</span></li>
<li><a name="a5264"></a><span class="src-doc">    *     typeDef = array(</span></li>
<li><a name="a5265"></a><span class="src-doc">    *     'elements' =&gt; array(), // refs to elements array</span></li>
<li><a name="a5266"></a><span class="src-doc">    *    'restrictionBase' =&gt; '',</span></li>
<li><a name="a5267"></a><span class="src-doc">    *    'phpType' =&gt; '',</span></li>
<li><a name="a5268"></a><span class="src-doc">    *    'order' =&gt; '(sequence|all)',</span></li>
<li><a name="a5269"></a><span class="src-doc">    *    'attrs' =&gt; array() // refs to attributes array</span></li>
<li><a name="a5270"></a><span class="src-doc">    *    )</span></li>
<li><a name="a5271"></a><span class="src-doc">    *</span></li>
<li><a name="a5272"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">the type</span></li>
<li><a name="a5273"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$ns </span><span class="src-doc">namespace (not prefix) of the type</span></li>
<li><a name="a5274"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span></li>
<li><a name="a5275"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5276"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a5277"></a><span class="src-doc">    */</span></li>
<li><a name="a5278"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5279"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: type=<span class="src-var">$type</span>, ns=<span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5280"></a>        <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">! </span><span class="src-var">$ns</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5281"></a>            <span class="src-var">$ns </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5282"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: type namespace forced to <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5283"></a>        <span class="src-sym">}</span></li>
<li><a name="a5284"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5285"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a> <span class="src-key">as </span><span class="src-var">$ns0 </span>=&gt; <span class="src-var">$schema0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5286"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strcasecmp">strcasecmp</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">, </span><span class="src-var">$ns0</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5287"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: replacing schema namespace <span class="src-var">$ns</span> with <span class="src-var">$ns0</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5288"></a>                    <span class="src-var">$ns </span>= <span class="src-var">$ns0</span><span class="src-sym">;</span></li>
<li><a name="a5289"></a>                    <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a5290"></a>                <span class="src-sym">}</span></li>
<li><a name="a5291"></a>            <span class="src-sym">}</span></li>
<li><a name="a5292"></a>        <span class="src-sym">}</span></li>
<li><a name="a5293"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5294"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: have schema for namespace <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5295"></a>            <span class="src-key">for </span><span class="src-sym">(</span><span class="src-var">$i </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$i </span>&lt; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-var">$i</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5296"></a>                <span class="src-var">$xs </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$ns</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5297"></a>                <span class="src-var">$t </span>= <span class="src-var">$xs</span><span class="src-sym">-&gt;</span><span class="src-id">getTypeDef</span><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5298"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$xs</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5299"></a>                <span class="src-var">$xs</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5300"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5301"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: found type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5302"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5303"></a>                        <span class="src-comm">// get info for type to tack onto the element</span></li>
<li><a name="a5304"></a>                        <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5305"></a>                        <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5306"></a>                        <span class="src-var">$etype </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5307"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5308"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">found type for [element] <span class="src-var">$type</span>:</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5309"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5310"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5311"></a>                                <span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5312"></a>                            <span class="src-sym">}</span></li>
<li><a name="a5313"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5314"></a>                                <span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5315"></a>                            <span class="src-sym">}</span></li>
<li><a name="a5316"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5317"></a>                                <span class="src-var">$t</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">] </span>= <span class="src-var">$etype</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5318"></a>                            <span class="src-sym">}</span></li>
<li><a name="a5319"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5320"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">did not find type for [element] <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5321"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5322"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5323"></a>                    <span class="src-key">return </span><span class="src-var">$t</span><span class="src-sym">;</span></li>
<li><a name="a5324"></a>                <span class="src-sym">}</span></li>
<li><a name="a5325"></a>            <span class="src-sym">}</span></li>
<li><a name="a5326"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: did not find type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5327"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5328"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getTypeDef: do not have schema for namespace <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5329"></a>        <span class="src-sym">}</span></li>
<li><a name="a5330"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5331"></a>    <span class="src-sym">}</span></li>
<li><a name="a5332"></a>&nbsp;</li>
<li><a name="a5333"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5334"></a><span class="src-doc">    * prints html description of services</span></li>
<li><a name="a5335"></a><span class="src-doc">    *</span></li>
<li><a name="a5336"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a5337"></a><span class="src-doc">    */</span></li>
<li><a name="a5338"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodwebDescription">webDescription</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a5339"></a>        <span class="src-key">global </span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">;</span></li>
<li><a name="a5340"></a>&nbsp;</li>
<li><a name="a5341"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5342"></a>            <span class="src-var">$PHP_SELF </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5343"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5344"></a>            <span class="src-var">$PHP_SELF </span>= <span class="src-var">$HTTP_SERVER_VARS</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5345"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5346"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;Neither _SERVER nor HTTP_SERVER_VARS is available&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5347"></a>        <span class="src-sym">}</span></li>
<li><a name="a5348"></a>&nbsp;</li>
<li><a name="a5349"></a>        <span class="src-var">$b </span>= <span class="src-str">'</span></li>
<li><a name="a5350"></a><span class="src-str">        &lt;html&gt;&lt;head&gt;&lt;title&gt;NuSOAP: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName</span>.<span class="src-str">'&lt;/title&gt;</span></li>
<li><a name="a5351"></a><span class="src-str">        &lt;style type=&quot;text/css&quot;&gt;</span></li>
<li><a name="a5352"></a><span class="src-str">            body    { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }</span></li>
<li><a name="a5353"></a><span class="src-str">            p       { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }</span></li>
<li><a name="a5354"></a><span class="src-str">            pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}</span></li>
<li><a name="a5355"></a><span class="src-str">            ul      { margin-top: 10px; margin-left: 20px; }</span></li>
<li><a name="a5356"></a><span class="src-str">            li      { list-style-type: none; margin-top: 10px; color: #000000; }</span></li>
<li><a name="a5357"></a><span class="src-str">            .content{</span></li>
<li><a name="a5358"></a><span class="src-str">            margin-left: 0px; padding-bottom: 2em; }</span></li>
<li><a name="a5359"></a><span class="src-str">            .nav {</span></li>
<li><a name="a5360"></a><span class="src-str">            padding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;</span></li>
<li><a name="a5361"></a><span class="src-str">            margin-top: 10px; margin-left: 0px; color: #000000;</span></li>
<li><a name="a5362"></a><span class="src-str">            background-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }</span></li>
<li><a name="a5363"></a><span class="src-str">            .title {</span></li>
<li><a name="a5364"></a><span class="src-str">            font-family: arial; font-size: 26px; color: #ffffff;</span></li>
<li><a name="a5365"></a><span class="src-str">            background-color: #999999; width: 100%;</span></li>
<li><a name="a5366"></a><span class="src-str">            margin-left: 0px; margin-right: 0px;</span></li>
<li><a name="a5367"></a><span class="src-str">            padding-top: 10px; padding-bottom: 10px;}</span></li>
<li><a name="a5368"></a><span class="src-str">            .hidden {</span></li>
<li><a name="a5369"></a><span class="src-str">            position: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;</span></li>
<li><a name="a5370"></a><span class="src-str">            font-family: arial; overflow: hidden; width: 600;</span></li>
<li><a name="a5371"></a><span class="src-str">            padding: 20px; font-size: 10px; background-color: #999999;</span></li>
<li><a name="a5372"></a><span class="src-str">            layer-background-color:#FFFFFF; }</span></li>
<li><a name="a5373"></a><span class="src-str">            a,a:active  { color: charcoal; font-weight: bold; }</span></li>
<li><a name="a5374"></a><span class="src-str">            a:visited   { color: #666666; font-weight: bold; }</span></li>
<li><a name="a5375"></a><span class="src-str">            a:hover     { color: cc3300; font-weight: bold; }</span></li>
<li><a name="a5376"></a><span class="src-str">        &lt;/style&gt;</span></li>
<li><a name="a5377"></a><span class="src-str">        &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;</span></li>
<li><a name="a5378"></a><span class="src-str">        &lt;!--</span></li>
<li><a name="a5379"></a><span class="src-str">        // POP-UP CAPTIONS...</span></li>
<li><a name="a5380"></a><span class="src-str">        function lib_bwcheck(){ //Browsercheck (needed)</span></li>
<li><a name="a5381"></a><span class="src-str">            this.ver=navigator.appVersion</span></li>
<li><a name="a5382"></a><span class="src-str">            this.agent=navigator.userAgent</span></li>
<li><a name="a5383"></a><span class="src-str">            this.dom=document.getElementById?1:0</span></li>
<li><a name="a5384"></a><span class="src-str">            this.opera5=this.agent.indexOf(&quot;Opera 5&quot;)&gt;-1</span></li>
<li><a name="a5385"></a><span class="src-str">            this.ie5=(this.ver.indexOf(&quot;MSIE 5&quot;)&gt;-1 &amp;&amp; this.dom &amp;&amp; !this.opera5)?1:0;</span></li>
<li><a name="a5386"></a><span class="src-str">            this.ie6=(this.ver.indexOf(&quot;MSIE 6&quot;)&gt;-1 &amp;&amp; this.dom &amp;&amp; !this.opera5)?1:0;</span></li>
<li><a name="a5387"></a><span class="src-str">            this.ie4=(document.all &amp;&amp; !this.dom &amp;&amp; !this.opera5)?1:0;</span></li>
<li><a name="a5388"></a><span class="src-str">            this.ie=this.ie4||this.ie5||this.ie6</span></li>
<li><a name="a5389"></a><span class="src-str">            this.mac=this.agent.indexOf(&quot;Mac&quot;)&gt;-1</span></li>
<li><a name="a5390"></a><span class="src-str">            this.ns6=(this.dom &amp;&amp; parseInt(this.ver) &gt;= 5) ?1:0;</span></li>
<li><a name="a5391"></a><span class="src-str">            this.ns4=(document.layers &amp;&amp; !this.dom)?1:0;</span></li>
<li><a name="a5392"></a><span class="src-str">            this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)</span></li>
<li><a name="a5393"></a><span class="src-str">            return this</span></li>
<li><a name="a5394"></a><span class="src-str">        }</span></li>
<li><a name="a5395"></a><span class="src-str">        var bw = new lib_bwcheck()</span></li>
<li><a name="a5396"></a><span class="src-str">        //Makes crossbrowser object.</span></li>
<li><a name="a5397"></a><span class="src-str">        function makeObj(obj){</span></li>
<li><a name="a5398"></a><span class="src-str">            this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;</span></li>
<li><a name="a5399"></a><span class="src-str">            if(!this.evnt) return false</span></li>
<li><a name="a5400"></a><span class="src-str">            this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;</span></li>
<li><a name="a5401"></a><span class="src-str">            this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;</span></li>
<li><a name="a5402"></a><span class="src-str">            this.writeIt=b_writeIt;</span></li>
<li><a name="a5403"></a><span class="src-str">            return this</span></li>
<li><a name="a5404"></a><span class="src-str">        }</span></li>
<li><a name="a5405"></a><span class="src-str">        // A unit of measure that will be added when setting the position of a layer.</span></li>
<li><a name="a5406"></a><span class="src-str">        //var px = bw.ns4||window.opera?&quot;&quot;:&quot;px&quot;;</span></li>
<li><a name="a5407"></a><span class="src-str">        function b_writeIt(text){</span></li>
<li><a name="a5408"></a><span class="src-str">            if (bw.ns4){this.wref.write(text);this.wref.close()}</span></li>
<li><a name="a5409"></a><span class="src-str">            else this.wref.innerHTML = text</span></li>
<li><a name="a5410"></a><span class="src-str">        }</span></li>
<li><a name="a5411"></a><span class="src-str">        //Shows the messages</span></li>
<li><a name="a5412"></a><span class="src-str">        var oDesc;</span></li>
<li><a name="a5413"></a><span class="src-str">        function popup(divid){</span></li>
<li><a name="a5414"></a><span class="src-str">            if(oDesc = new makeObj(divid)){</span></li>
<li><a name="a5415"></a><span class="src-str">            oDesc.css.visibility = &quot;visible&quot;</span></li>
<li><a name="a5416"></a><span class="src-str">            }</span></li>
<li><a name="a5417"></a><span class="src-str">        }</span></li>
<li><a name="a5418"></a><span class="src-str">        function popout(){ // Hides message</span></li>
<li><a name="a5419"></a><span class="src-str">            if(oDesc) oDesc.css.visibility = &quot;hidden&quot;</span></li>
<li><a name="a5420"></a><span class="src-str">        }</span></li>
<li><a name="a5421"></a><span class="src-str">        //--&gt;</span></li>
<li><a name="a5422"></a><span class="src-str">        &lt;/script&gt;</span></li>
<li><a name="a5423"></a><span class="src-str">        &lt;/head&gt;</span></li>
<li><a name="a5424"></a><span class="src-str">        &lt;body&gt;</span></li>
<li><a name="a5425"></a><span class="src-str">        &lt;div class=content&gt;</span></li>
<li><a name="a5426"></a><span class="src-str">            &lt;br&gt;&lt;br&gt;</span></li>
<li><a name="a5427"></a><span class="src-str">            &lt;div class=title&gt;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName</span>.<span class="src-str">'&lt;/div&gt;</span></li>
<li><a name="a5428"></a><span class="src-str">            &lt;div class=nav&gt;</span></li>
<li><a name="a5429"></a><span class="src-str">                &lt;p&gt;View the &lt;a href=&quot;'</span>.<span class="src-var">$PHP_SELF</span>.<span class="src-str">'?wsdl&quot;&gt;WSDL&lt;/a&gt; for the service.</span></li>
<li><a name="a5430"></a><span class="src-str">                Click on an operation name to view it&amp;apos;s details.&lt;/p&gt;</span></li>
<li><a name="a5431"></a><span class="src-str">                &lt;ul&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5432"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetOperations">getOperations</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$op </span>=&gt; <span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a5433"></a>                    <span class="src-var">$b </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;li&gt;&lt;a href='#' onclick=\&quot;popout();popup('<span class="src-var">$op</span>')\&quot;&gt;<span class="src-var">$op</span>&lt;/a&gt;&lt;/li&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5434"></a>                    <span class="src-comm">// create hidden div</span></li>
<li><a name="a5435"></a>                    <span class="src-var">$b </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;div id='<span class="src-var">$op</span>' class='hidden'&gt;</span></li>
<li><a name="a5436"></a></span><span class="src-str">                    &lt;a href='#' onclick='popout()'&gt;&lt;font color='#ffffff'&gt;Close&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5437"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$data </span><span class="src-key">as </span><span class="src-var">$donnie </span>=&gt; <span class="src-var">$marie</span><span class="src-sym">)</span><span class="src-sym">{ </span><span class="src-comm">// loop through opdata</span></li>
<li><a name="a5438"></a>                        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$donnie </span>== <span class="src-str">'input' </span>|| <span class="src-var">$donnie </span>== <span class="src-str">'output'</span><span class="src-sym">)</span><span class="src-sym">{ </span><span class="src-comm">// show input/output data</span></li>
<li><a name="a5439"></a>                            <span class="src-var">$b </span>.= <span class="src-str">&quot;&lt;font color='white'&gt;&quot;</span>.<a href="http://www.php.net/ucfirst">ucfirst</a><span class="src-sym">(</span><span class="src-var">$donnie</span><span class="src-sym">)</span>.<span class="src-str">':&lt;/font&gt;&lt;br&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5440"></a>                            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$marie </span><span class="src-key">as </span><span class="src-var">$captain </span>=&gt; <span class="src-var">$tenille</span><span class="src-sym">)</span><span class="src-sym">{ </span><span class="src-comm">// loop through data</span></li>
<li><a name="a5441"></a>                                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$captain </span>== <span class="src-str">'parts'</span><span class="src-sym">)</span><span class="src-sym">{ </span><span class="src-comm">// loop thru parts</span></li>
<li><a name="a5442"></a>                                    <span class="src-var">$b </span>.= <span class="src-str">&quot;</span><span class="src-str">&amp;nbsp;&amp;nbsp;<span class="src-var">$captain</span>:&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5443"></a>                                    <span class="src-comm">//if(is_array($tenille)){</span></li>
<li><a name="a5444"></a>                                        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$tenille </span><span class="src-key">as </span><span class="src-var">$joanie </span>=&gt; <span class="src-var">$chachi</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a5445"></a>                                            <span class="src-var">$b </span>.= <span class="src-str">&quot;</span><span class="src-str">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;<span class="src-var">$joanie</span>: <span class="src-var">$chachi</span>&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5446"></a>                                        <span class="src-sym">}</span></li>
<li><a name="a5447"></a>                                    <span class="src-comm">//}</span></li>
<li><a name="a5448"></a>                                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5449"></a>                                    <span class="src-var">$b </span>.= <span class="src-str">&quot;</span><span class="src-str">&amp;nbsp;&amp;nbsp;<span class="src-var">$captain</span>: <span class="src-var">$tenille</span>&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5450"></a>                                <span class="src-sym">}</span></li>
<li><a name="a5451"></a>                            <span class="src-sym">}</span></li>
<li><a name="a5452"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5453"></a>                            <span class="src-var">$b </span>.= <span class="src-str">&quot;&lt;font color='white'&gt;&quot;</span>.<a href="http://www.php.net/ucfirst">ucfirst</a><span class="src-sym">(</span><span class="src-var">$donnie</span><span class="src-sym">)</span>.<span class="src-str">&quot;</span><span class="src-str">:&lt;/font&gt; <span class="src-var">$marie</span>&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5454"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5455"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5456"></a>                    <span class="src-var">$b </span>.= <span class="src-str">'&lt;/div&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5457"></a>                <span class="src-sym">}</span></li>
<li><a name="a5458"></a>                <span class="src-var">$b </span>.= <span class="src-str">'</span></li>
<li><a name="a5459"></a><span class="src-str">                &lt;ul&gt;</span></li>
<li><a name="a5460"></a><span class="src-str">            &lt;/div&gt;</span></li>
<li><a name="a5461"></a><span class="src-str">        &lt;/div&gt;&lt;/body&gt;&lt;/html&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5462"></a>        <span class="src-key">return </span><span class="src-var">$b</span><span class="src-sym">;</span></li>
<li><a name="a5463"></a>    <span class="src-sym">}</span></li>
<li><a name="a5464"></a>&nbsp;</li>
<li><a name="a5465"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5466"></a><span class="src-doc">    * serialize the parsed wsdl</span></li>
<li><a name="a5467"></a><span class="src-doc">    *</span></li>
<li><a name="a5468"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$debug </span><span class="src-doc">whether to put debug=1 in endpoint URL</span></li>
<li><a name="a5469"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">serialization of WSDL</span></li>
<li><a name="a5470"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5471"></a><span class="src-doc">    */</span></li>
<li><a name="a5472"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserialize">serialize</a><span class="src-sym">(</span><span class="src-var">$debug </span>= <span class="src-num">0</span><span class="src-sym">)</span></li>
<li><a name="a5473"></a>    <span class="src-sym">{</span></li>
<li><a name="a5474"></a>        <span class="src-var">$xml </span>= <span class="src-str">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5475"></a>        <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&lt;definitions&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5476"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a> <span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5477"></a>            <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str"> xmlns:<span class="src-var">$k</span>=\&quot;<span class="src-var">$v</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5478"></a>        <span class="src-sym">} </span></li>
<li><a name="a5479"></a>        <span class="src-comm">// 10.9.02 - add poulter fix for wsdl and tns declarations</span></li>
<li><a name="a5480"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'wsdl'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5481"></a>            <span class="src-var">$xml </span>.= <span class="src-str">&quot; xmlns=\&quot;&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'wsdl'</span><span class="src-sym">] </span>. <span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5482"></a>        <span class="src-sym">} </span></li>
<li><a name="a5483"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5484"></a>            <span class="src-var">$xml </span>.= <span class="src-str">&quot; targetNamespace=\&quot;&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">] </span>. <span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5485"></a>        <span class="src-sym">} </span></li>
<li><a name="a5486"></a>        <span class="src-var">$xml </span>.= <span class="src-str">'&gt;'</span><span class="src-sym">; </span></li>
<li><a name="a5487"></a>        <span class="src-comm">// imports</span></li>
<li><a name="a5488"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5489"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$import">import</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$list</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5490"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$list </span><span class="src-key">as </span><span class="src-var">$ii</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5491"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ii</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5492"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">'&lt;import location=&quot;' </span>. <span class="src-var">$ii</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; namespace=&quot;' </span>. <span class="src-var">$ns </span>. <span class="src-str">'&quot; /&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5493"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5494"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">'&lt;import namespace=&quot;' </span>. <span class="src-var">$ns </span>. <span class="src-str">'&quot; /&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5495"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5496"></a>                <span class="src-sym">}</span></li>
<li><a name="a5497"></a>            <span class="src-sym">} </span></li>
<li><a name="a5498"></a>        <span class="src-sym">} </span></li>
<li><a name="a5499"></a>        <span class="src-comm">// types</span></li>
<li><a name="a5500"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">)</span>&gt;=<span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5501"></a>            <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&lt;types&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5502"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$list</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5503"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$list </span><span class="src-key">as </span><span class="src-var">$xs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5504"></a>                    <span class="src-var">$xml </span>.= <span class="src-var">$xs</span><span class="src-sym">-&gt;</span><span class="src-id">serializeSchema</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5505"></a>                <span class="src-sym">}</span></li>
<li><a name="a5506"></a>            <span class="src-sym">}</span></li>
<li><a name="a5507"></a>            <span class="src-var">$xml </span>.= <span class="src-str">'&lt;/types&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5508"></a>        <span class="src-sym">} </span></li>
<li><a name="a5509"></a>        <span class="src-comm">// messages</span></li>
<li><a name="a5510"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">) </span>&gt;= <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5511"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a> <span class="src-key">as </span><span class="src-var">$msgName </span>=&gt; <span class="src-var">$msgParts</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5512"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&lt;message name=\&quot;&quot; </span>. <span class="src-var">$msgName </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5513"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$msgParts</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a5514"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$msgParts </span><span class="src-key">as </span><span class="src-var">$partName </span>=&gt; <span class="src-var">$partType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5515"></a>                        <span class="src-comm">// print 'serializing '.$partType.', sv: '.$this-&gt;XMLSchemaVersion.'&lt;br&gt;';</span></li>
<li><a name="a5516"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$partType</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5517"></a>                            <span class="src-var">$typePrefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$partType</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5518"></a>                        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsd'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-var">$partType</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5519"></a>                            <span class="src-comm">// print 'checking typemap: '.$this-&gt;XMLSchemaVersion.'&lt;br&gt;';</span></li>
<li><a name="a5520"></a>                            <span class="src-var">$typePrefix </span>= <span class="src-str">'xsd'</span><span class="src-sym">;</span></li>
<li><a name="a5521"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5522"></a>                            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a> <span class="src-key">as </span><span class="src-var">$ns </span>=&gt; <span class="src-var">$types</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5523"></a>                                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$types</span><span class="src-sym">[</span><span class="src-var">$partType</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5524"></a>                                    <span class="src-var">$typePrefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5525"></a>                                <span class="src-sym">} </span></li>
<li><a name="a5526"></a>                            <span class="src-sym">} </span></li>
<li><a name="a5527"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$typePrefix</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5528"></a>                                <span class="src-key">die</span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$partType</span> has no namespace!</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5529"></a>                            <span class="src-sym">} </span></li>
<li><a name="a5530"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5531"></a>                        <span class="src-var">$ns </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$typePrefix</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5532"></a>                        <span class="src-var">$localPart </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$partType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5533"></a>                        <span class="src-var">$typeDef </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$localPart</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5534"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>== <span class="src-str">'element'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5535"></a>                            <span class="src-var">$elementortype </span>= <span class="src-str">'element'</span><span class="src-sym">;</span></li>
<li><a name="a5536"></a>                            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$localPart</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">'^'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5537"></a>                                <span class="src-var">$localPart </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$localPart</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5538"></a>                            <span class="src-sym">}</span></li>
<li><a name="a5539"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5540"></a>                            <span class="src-var">$elementortype </span>= <span class="src-str">'type'</span><span class="src-sym">;</span></li>
<li><a name="a5541"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5542"></a>                        <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;part name=&quot;' </span>. <span class="src-var">$partName </span>. <span class="src-str">'&quot; ' </span>. <span class="src-var">$elementortype </span>. <span class="src-str">'=&quot;' </span>. <span class="src-var">$typePrefix </span>. <span class="src-str">':' </span>. <span class="src-var">$localPart </span>. <span class="src-str">'&quot; /&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5543"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5544"></a>                <span class="src-sym">}</span></li>
<li><a name="a5545"></a>                <span class="src-var">$xml </span>.= <span class="src-str">'&lt;/message&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5546"></a>            <span class="src-sym">} </span></li>
<li><a name="a5547"></a>        <span class="src-sym">} </span></li>
<li><a name="a5548"></a>        <span class="src-comm">// bindings &amp; porttypes</span></li>
<li><a name="a5549"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">) </span>&gt;= <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5550"></a>            <span class="src-var">$binding_xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5551"></a>            <span class="src-var">$portType_xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5552"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a> <span class="src-key">as </span><span class="src-var">$bindingName </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5553"></a>                <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&lt;binding name=\&quot;&quot; </span>. <span class="src-var">$bindingName </span>. <span class="src-str">'&quot; type=&quot;tns:' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5554"></a>                <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;soap:binding style=&quot;' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; transport=&quot;' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'transport'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;/&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5555"></a>                <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&lt;portType name=\&quot;&quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'portType'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5556"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$opName </span>=&gt; <span class="src-var">$opParts</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5557"></a>                    <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;operation name=&quot;' </span>. <span class="src-var">$opName </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5558"></a>                    <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;soap:operation soapAction=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; style=&quot;'</span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;/&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5559"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5560"></a>                        <span class="src-var">$enc_style </span>= <span class="src-str">' encodingStyle=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a5561"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5562"></a>                        <span class="src-var">$enc_style </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5563"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5564"></a>                    <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;input&gt;&lt;soap:body use=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; namespace=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;' </span>. <span class="src-var">$enc_style </span>. <span class="src-str">'/&gt;&lt;/input&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5565"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5566"></a>                        <span class="src-var">$enc_style </span>= <span class="src-str">' encodingStyle=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a5567"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5568"></a>                        <span class="src-var">$enc_style </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5569"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5570"></a>                    <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;output&gt;&lt;soap:body use=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">] </span>. <span class="src-str">'&quot; namespace=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;' </span>. <span class="src-var">$enc_style </span>. <span class="src-str">'/&gt;&lt;/output&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5571"></a>                    <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;/operation&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5572"></a>                    <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;operation name=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a5573"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'parameterOrder'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5574"></a>                        <span class="src-var">$portType_xml </span>.= <span class="src-str">' parameterOrder=&quot;' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'parameterOrder'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a5575"></a>                    <span class="src-sym">} </span></li>
<li><a name="a5576"></a>                    <span class="src-var">$portType_xml </span>.= <span class="src-str">'&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5577"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5578"></a>                        <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;documentation&gt;' </span>. <a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'documentation'</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">'&lt;/documentation&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5579"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5580"></a>                    <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;input message=&quot;tns:' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;/&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5581"></a>                    <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;output message=&quot;tns:' </span>. <span class="src-var">$opParts</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;/&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5582"></a>                    <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;/operation&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5583"></a>                <span class="src-sym">} </span></li>
<li><a name="a5584"></a>                <span class="src-var">$portType_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'&lt;/portType&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5585"></a>                <span class="src-var">$binding_xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'&lt;/binding&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5586"></a>            <span class="src-sym">} </span></li>
<li><a name="a5587"></a>            <span class="src-var">$xml </span>.= <span class="src-var">$portType_xml </span>. <span class="src-var">$binding_xml</span><span class="src-sym">;</span></li>
<li><a name="a5588"></a>        <span class="src-sym">} </span></li>
<li><a name="a5589"></a>        <span class="src-comm">// services</span></li>
<li><a name="a5590"></a>        <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&lt;service name=\&quot;&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5591"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a><span class="src-sym">) </span>&gt;= <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5592"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$ports">ports</a> <span class="src-key">as </span><span class="src-var">$pName </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5593"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;port name=&quot;' </span>. <span class="src-var">$pName </span>. <span class="src-str">'&quot; binding=&quot;tns:' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'binding'</span><span class="src-sym">] </span>. <span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5594"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'    &lt;soap:address location=&quot;' </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'location'</span><span class="src-sym">] </span>. <span class="src-sym">(</span><span class="src-var">$debug </span>? <span class="src-str">'?debug=1' </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">'&quot;/&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5595"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'  &lt;/port&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5596"></a>            <span class="src-sym">} </span></li>
<li><a name="a5597"></a>        <span class="src-sym">} </span></li>
<li><a name="a5598"></a>        <span class="src-var">$xml </span>.= <span class="src-str">&quot;\n&quot; </span>. <span class="src-str">'&lt;/service&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5599"></a>        <span class="src-key">return </span><span class="src-var">$xml </span>. <span class="src-str">&quot;\n&lt;/definitions&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5600"></a>    <span class="src-sym">} </span></li>
<li><a name="a5601"></a>&nbsp;</li>
<li><a name="a5602"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5603"></a><span class="src-doc">     * determine whether a set of parameters are unwrapped</span></li>
<li><a name="a5604"></a><span class="src-doc">     * when they are expect to be wrapped, Microsoft-style.</span></li>
<li><a name="a5605"></a><span class="src-doc">     *</span></li>
<li><a name="a5606"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">the type (element name) of the wrapper</span></li>
<li><a name="a5607"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$parameters </span><span class="src-doc">the parameter values for the SOAP call</span></li>
<li><a name="a5608"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">boolean </span><span class="src-doc">whether they parameters are unwrapped (and should be wrapped)</span></li>
<li><a name="a5609"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a5610"></a><span class="src-doc">     */</span></li>
<li><a name="a5611"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodparametersMatchWrapped">parametersMatchWrapped</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-sym">&amp;</span><span class="src-var">$parameters</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5612"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped type=<span class="src-var">$type</span>, parameters=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5613"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5614"></a>&nbsp;</li>
<li><a name="a5615"></a>        <span class="src-comm">// split type into namespace:unqualified-type</span></li>
<li><a name="a5616"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5617"></a>            <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5618"></a>            <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5619"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: got a prefixed type: <span class="src-var">$uqType</span>, <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5620"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5621"></a>                <span class="src-var">$ns </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5622"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: expanded prefixed type: <span class="src-var">$uqType</span>, <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5623"></a>            <span class="src-sym">}</span></li>
<li><a name="a5624"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5625"></a>            <span class="src-comm">// TODO: should the type be compared to types in XSD, and the namespace</span></li>
<li><a name="a5626"></a>            <span class="src-comm">// set to XSD if the type matches?</span></li>
<li><a name="a5627"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: No namespace for type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5628"></a>            <span class="src-var">$ns </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5629"></a>            <span class="src-var">$uqType </span>= <span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a5630"></a>        <span class="src-sym">}</span></li>
<li><a name="a5631"></a>&nbsp;</li>
<li><a name="a5632"></a>        <span class="src-comm">// get the type information</span></li>
<li><a name="a5633"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$typeDef </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5634"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: <span class="src-var">$type</span> (<span class="src-var">$uqType</span>) is not a supported type.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5635"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5636"></a>        <span class="src-sym">}</span></li>
<li><a name="a5637"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in parametersMatchWrapped: found typeDef=&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5638"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5639"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">'^'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5640"></a>            <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5641"></a>        <span class="src-sym">}</span></li>
<li><a name="a5642"></a>        <span class="src-var">$phpType </span>= <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5643"></a>        <span class="src-var">$arrayType </span>= <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5644"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: uqType: <span class="src-var">$uqType</span>, ns: <span class="src-var">$ns</span>, phptype: <span class="src-var">$phpType</span>, arrayType: <span class="src-var">$arrayType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5645"></a>        </li>
<li><a name="a5646"></a>        <span class="src-comm">// we expect a complexType or element of complexType</span></li>
<li><a name="a5647"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$phpType </span>!= <span class="src-str">'struct'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5648"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in parametersMatchWrapped: not a struct&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5649"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5650"></a>        <span class="src-sym">}</span></li>
<li><a name="a5651"></a>&nbsp;</li>
<li><a name="a5652"></a>        <span class="src-comm">// see whether the parameter names match the elements</span></li>
<li><a name="a5653"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5654"></a>            <span class="src-var">$elements </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a5655"></a>            <span class="src-var">$matches </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a5656"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$name </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5657"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5658"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: have parameter named <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5659"></a>                    <span class="src-var">$matches</span>++<span class="src-sym">;</span></li>
<li><a name="a5660"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5661"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: do not have parameter named <span class="src-var">$name</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5662"></a>                <span class="src-sym">}</span></li>
<li><a name="a5663"></a>                <span class="src-var">$elements</span>++<span class="src-sym">;</span></li>
<li><a name="a5664"></a>            <span class="src-sym">}</span></li>
<li><a name="a5665"></a>&nbsp;</li>
<li><a name="a5666"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: <span class="src-var">$matches</span> parameter names match <span class="src-var">$elements</span> wrapped parameter names</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5667"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$matches </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5668"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5669"></a>            <span class="src-sym">}</span></li>
<li><a name="a5670"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a5671"></a>        <span class="src-sym">}</span></li>
<li><a name="a5672"></a>&nbsp;</li>
<li><a name="a5673"></a>        <span class="src-comm">// since there are no elements for the type, if the user passed no</span></li>
<li><a name="a5674"></a>        <span class="src-comm">// parameters, the parameters match wrapped.</span></li>
<li><a name="a5675"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in parametersMatchWrapped: no elements type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5676"></a>        <span class="src-key">return </span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a5677"></a>    <span class="src-sym">}</span></li>
<li><a name="a5678"></a>&nbsp;</li>
<li><a name="a5679"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5680"></a><span class="src-doc">     * serialize PHP values according to a WSDL message definition</span></li>
<li><a name="a5681"></a><span class="src-doc">     * contrary to the method name, this is not limited to RPC</span></li>
<li><a name="a5682"></a><span class="src-doc">     *</span></li>
<li><a name="a5683"></a><span class="src-doc">     * TODO</span></li>
<li><a name="a5684"></a><span class="src-doc">     * - multi-ref serialization</span></li>
<li><a name="a5685"></a><span class="src-doc">     * - validate PHP values against type definitions, return errors if invalid</span></li>
<li><a name="a5686"></a><span class="src-doc">     * </span></li>
<li><a name="a5687"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$operation </span><span class="src-doc">operation name</span></li>
<li><a name="a5688"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$direction </span><span class="src-doc">(input|output)</span></li>
<li><a name="a5689"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$parameters </span><span class="src-doc">parameter value(s)</span></li>
<li><a name="a5690"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$bindingType </span><span class="src-doc">(soap|soap12)</span></li>
<li><a name="a5691"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">parameters serialized as XML or false on error (e.g. operation not found)</span></li>
<li><a name="a5692"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5693"></a><span class="src-doc">     */</span></li>
<li><a name="a5694"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserializeRPCParameters">serializeRPCParameters</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">, </span><span class="src-var">$direction</span><span class="src-sym">, </span><span class="src-var">$parameters</span><span class="src-sym">, </span><span class="src-var">$bindingType </span>= <span class="src-str">'soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5695"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeRPCParameters: operation=<span class="src-var">$operation</span>, direction=<span class="src-var">$direction</span>, XMLSchemaVersion=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a>, bindingType=<span class="src-var">$bindingType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5696"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'parameters=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5697"></a>        </li>
<li><a name="a5698"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$direction </span>!= <span class="src-str">'input' </span>&amp;&amp; <span class="src-var">$direction </span>!= <span class="src-str">'output'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5699"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The value of the \$direction argument needs to be either &quot;input&quot; or &quot;output&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5700"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'The value of the \$direction argument needs to be either &quot;input&quot; or &quot;output&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5701"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5702"></a>        <span class="src-sym">} </span></li>
<li><a name="a5703"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetOperationData">getOperationData</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">, </span><span class="src-var">$bindingType</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5704"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Unable to retrieve WSDL data for operation: ' </span>. <span class="src-var">$operation </span>. <span class="src-str">' bindingType: ' </span>. <span class="src-var">$bindingType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5705"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Unable to retrieve WSDL data for operation: ' </span>. <span class="src-var">$operation </span>. <span class="src-str">' bindingType: ' </span>. <span class="src-var">$bindingType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5706"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5707"></a>        <span class="src-sym">}</span></li>
<li><a name="a5708"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in serializeRPCParameters: opData:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5709"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5710"></a>&nbsp;</li>
<li><a name="a5711"></a>        <span class="src-comm">// Get encoding style for output and set to current</span></li>
<li><a name="a5712"></a>        <span class="src-var">$encodingStyle </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">;</span></li>
<li><a name="a5713"></a>        <span class="src-key">if</span><span class="src-sym">((</span><span class="src-var">$direction </span>== <span class="src-str">'input'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>!= <span class="src-var">$encodingStyle</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5714"></a>            <span class="src-var">$encodingStyle </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5715"></a>            <span class="src-var">$enc_style </span>= <span class="src-var">$encodingStyle</span><span class="src-sym">;</span></li>
<li><a name="a5716"></a>        <span class="src-sym">}</span></li>
<li><a name="a5717"></a>&nbsp;</li>
<li><a name="a5718"></a>        <span class="src-comm">// set input params</span></li>
<li><a name="a5719"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5720"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5721"></a>            <span class="src-var">$parts </span>= <span class="src-sym">&amp;</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5722"></a>            <span class="src-var">$part_count </span>= <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5723"></a>            <span class="src-var">$style </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5724"></a>            <span class="src-var">$use </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5725"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">have <span class="src-var">$part_count</span> part(s) to serialize using <span class="src-var">$style</span>/<span class="src-var">$use</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5726"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5727"></a>                <span class="src-var">$parametersArrayType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5728"></a>                <span class="src-var">$parameter_count </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5729"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">have <span class="src-var">$parameter_count</span> parameter(s) provided as <span class="src-var">$parametersArrayType</span> to serialize</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5730"></a>                <span class="src-comm">// check for Microsoft-style wrapped parameters</span></li>
<li><a name="a5731"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$style </span>== <span class="src-str">'document' </span>&amp;&amp; <span class="src-var">$use </span>== <span class="src-str">'literal' </span>&amp;&amp; <span class="src-var">$part_count </span>== <span class="src-num">1 </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-str">'parameters'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5732"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'check whether the caller has wrapped the parameters'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5733"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$direction </span>== <span class="src-str">'output' </span>&amp;&amp; <span class="src-var">$parametersArrayType </span>== <span class="src-str">'arraySimple' </span>&amp;&amp; <span class="src-var">$parameter_count </span>== <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5734"></a>                        <span class="src-comm">// TODO: consider checking here for double-wrapping, when</span></li>
<li><a name="a5735"></a>                        <span class="src-comm">// service function wraps, then NuSOAP wraps again</span></li>
<li><a name="a5736"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;change simple array to associative with 'parameters' element&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5737"></a>                        <span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-str">'parameters'</span><span class="src-sym">] </span>= <span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5738"></a>                        unset<span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5739"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5740"></a>                    <span class="src-key">if </span><span class="src-sym">((</span><span class="src-var">$parametersArrayType </span>== <span class="src-str">'arrayStruct' </span>|| <span class="src-var">$parameter_count </span>== <span class="src-num">0</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-str">'parameters'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5741"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'check whether caller\'s parameters match the wrapped ones'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5742"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodparametersMatchWrapped">parametersMatchWrapped</a><span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-str">'parameters'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$parameters</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5743"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'wrap the parameters for the caller'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5744"></a>                            <span class="src-var">$parameters </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'parameters' </span>=&gt; <span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5745"></a>                            <span class="src-var">$parameter_count </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a5746"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5747"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5748"></a>                <span class="src-sym">}</span></li>
<li><a name="a5749"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$parts </span><span class="src-key">as </span><span class="src-var">$name </span>=&gt; <span class="src-var">$type</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5750"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing part <span class="src-var">$name</span> of type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5751"></a>                    <span class="src-comm">// Track encoding style</span></li>
<li><a name="a5752"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$encodingStyle </span>!= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5753"></a>                        <span class="src-var">$encodingStyle </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;            </span></li>
<li><a name="a5754"></a>                        <span class="src-var">$enc_style </span>= <span class="src-var">$encodingStyle</span><span class="src-sym">;</span></li>
<li><a name="a5755"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5756"></a>                        <span class="src-var">$enc_style </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5757"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5758"></a>                    <span class="src-comm">// NOTE: add error handling here</span></li>
<li><a name="a5759"></a>                    <span class="src-comm">// if serializeType returns false, then catch global error and fault</span></li>
<li><a name="a5760"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$parametersArrayType </span>== <span class="src-str">'arraySimple'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5761"></a>                        <span class="src-var">$p </span>= <a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5762"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/indexed param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5763"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$p</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5764"></a>                    <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5765"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/named param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5766"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5767"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5768"></a>                        <span class="src-comm">// TODO: only send nillable</span></li>
<li><a name="a5769"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/null param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5770"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5771"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5772"></a>                <span class="src-sym">}</span></li>
<li><a name="a5773"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5774"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no parameters passed.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5775"></a>            <span class="src-sym">}</span></li>
<li><a name="a5776"></a>        <span class="src-sym">}</span></li>
<li><a name="a5777"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializeRPCParameters returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5778"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a5779"></a>    <span class="src-sym">} </span></li>
<li><a name="a5780"></a>    </li>
<li><a name="a5781"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5782"></a><span class="src-doc">     * serialize a PHP value according to a WSDL message definition</span></li>
<li><a name="a5783"></a><span class="src-doc">     * </span></li>
<li><a name="a5784"></a><span class="src-doc">     * TODO</span></li>
<li><a name="a5785"></a><span class="src-doc">     * - multi-ref serialization</span></li>
<li><a name="a5786"></a><span class="src-doc">     * - validate PHP values against type definitions, return errors if invalid</span></li>
<li><a name="a5787"></a><span class="src-doc">     * </span></li>
<li><a name="a5788"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$operation </span><span class="src-doc">operation name</span></li>
<li><a name="a5789"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$direction </span><span class="src-doc">(input|output)</span></li>
<li><a name="a5790"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$parameters </span><span class="src-doc">parameter value(s)</span></li>
<li><a name="a5791"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">mixed </span><span class="src-doc">parameters serialized as XML or false on error (e.g. operation not found)</span></li>
<li><a name="a5792"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a5793"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a5794"></a><span class="src-doc">     */</span></li>
<li><a name="a5795"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserializeParameters">serializeParameters</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">, </span><span class="src-var">$direction</span><span class="src-sym">, </span><span class="src-var">$parameters</span><span class="src-sym">)</span></li>
<li><a name="a5796"></a>    <span class="src-sym">{</span></li>
<li><a name="a5797"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeParameters: operation=<span class="src-var">$operation</span>, direction=<span class="src-var">$direction</span>, XMLSchemaVersion=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a5798"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'parameters=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5799"></a>        </li>
<li><a name="a5800"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$direction </span>!= <span class="src-str">'input' </span>&amp;&amp; <span class="src-var">$direction </span>!= <span class="src-str">'output'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5801"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'The value of the \$direction argument needs to be either &quot;input&quot; or &quot;output&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5802"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'The value of the \$direction argument needs to be either &quot;input&quot; or &quot;output&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5803"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5804"></a>        <span class="src-sym">} </span></li>
<li><a name="a5805"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetOperationData">getOperationData</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5806"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Unable to retrieve WSDL data for operation: ' </span>. <span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5807"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Unable to retrieve WSDL data for operation: ' </span>. <span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5808"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5809"></a>        <span class="src-sym">}</span></li>
<li><a name="a5810"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'opData:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5811"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5812"></a>        </li>
<li><a name="a5813"></a>        <span class="src-comm">// Get encoding style for output and set to current</span></li>
<li><a name="a5814"></a>        <span class="src-var">$encodingStyle </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">;</span></li>
<li><a name="a5815"></a>        <span class="src-key">if</span><span class="src-sym">((</span><span class="src-var">$direction </span>== <span class="src-str">'input'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">] </span>!= <span class="src-var">$encodingStyle</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5816"></a>            <span class="src-var">$encodingStyle </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'output'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5817"></a>            <span class="src-var">$enc_style </span>= <span class="src-var">$encodingStyle</span><span class="src-sym">;</span></li>
<li><a name="a5818"></a>        <span class="src-sym">}</span></li>
<li><a name="a5819"></a>        </li>
<li><a name="a5820"></a>        <span class="src-comm">// set input params</span></li>
<li><a name="a5821"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5822"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5823"></a>            </li>
<li><a name="a5824"></a>            <span class="src-var">$use </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a5825"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">use=<span class="src-var">$use</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5826"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got ' </span>. <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">' part(s)'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5827"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5828"></a>                <span class="src-var">$parametersArrayType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5829"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'have ' </span>. <span class="src-var">$parametersArrayType </span>. <span class="src-str">' parameters'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5830"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$name </span>=&gt; <span class="src-var">$type</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5831"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'serializing part &quot;'</span>.<span class="src-var">$name</span>.<span class="src-str">'&quot; of type &quot;'</span>.<span class="src-var">$type</span>.<span class="src-str">'&quot;'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5832"></a>                    <span class="src-comm">// Track encoding style</span></li>
<li><a name="a5833"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$encodingStyle </span>!= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5834"></a>                        <span class="src-var">$encodingStyle </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-var">$direction</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;            </span></li>
<li><a name="a5835"></a>                        <span class="src-var">$enc_style </span>= <span class="src-var">$encodingStyle</span><span class="src-sym">;</span></li>
<li><a name="a5836"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5837"></a>                        <span class="src-var">$enc_style </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5838"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5839"></a>                    <span class="src-comm">// NOTE: add error handling here</span></li>
<li><a name="a5840"></a>                    <span class="src-comm">// if serializeType returns false, then catch global error and fault</span></li>
<li><a name="a5841"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$parametersArrayType </span>== <span class="src-str">'arraySimple'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5842"></a>                        <span class="src-var">$p </span>= <a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5843"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/indexed param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5844"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$p</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5845"></a>                    <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5846"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/named param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5847"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$parameters</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5848"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5849"></a>                        <span class="src-comm">// TODO: only send nillable</span></li>
<li><a name="a5850"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'calling serializeType w/null param'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5851"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$enc_style</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5852"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5853"></a>                <span class="src-sym">}</span></li>
<li><a name="a5854"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5855"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'no parameters passed.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5856"></a>            <span class="src-sym">}</span></li>
<li><a name="a5857"></a>        <span class="src-sym">}</span></li>
<li><a name="a5858"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializeParameters returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5859"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a5860"></a>    <span class="src-sym">} </span></li>
<li><a name="a5861"></a>    </li>
<li><a name="a5862"></a>    <span class="src-doc">/**</span></li>
<li><a name="a5863"></a><span class="src-doc">     * serializes a PHP value according a given type definition</span></li>
<li><a name="a5864"></a><span class="src-doc">     * </span></li>
<li><a name="a5865"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">name of value (part or element)</span></li>
<li><a name="a5866"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">XML schema type of value (type or element)</span></li>
<li><a name="a5867"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">a native PHP value (parameter value)</span></li>
<li><a name="a5868"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$use </span><span class="src-doc">use for part (encoded|literal)</span></li>
<li><a name="a5869"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$encodingStyle </span><span class="src-doc">SOAP encoding style for the value (if different than the enclosing style)</span></li>
<li><a name="a5870"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$unqualified </span><span class="src-doc">a kludge for what should be XML namespace form handling</span></li>
<li><a name="a5871"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">value serialized as an XML string</span></li>
<li><a name="a5872"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a5873"></a><span class="src-doc">     */</span></li>
<li><a name="a5874"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span>=<span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$unqualified</span>=<span class="src-id">false</span><span class="src-sym">)</span></li>
<li><a name="a5875"></a>    <span class="src-sym">{</span></li>
<li><a name="a5876"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: name=<span class="src-var">$name</span>, type=<span class="src-var">$type</span>, use=<span class="src-var">$use</span>, encodingStyle=<span class="src-var">$encodingStyle</span>, unqualified=</span><span class="src-str">&quot; </span>. <span class="src-sym">(</span><span class="src-var">$unqualified </span>? <span class="src-str">&quot;unqualified&quot; </span>: <span class="src-str">&quot;qualified&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5877"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">&quot;value=&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5878"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'encoded' </span>&amp;&amp; <span class="src-var">$encodingStyle</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5879"></a>            <span class="src-var">$encodingStyle </span>= <span class="src-str">' SOAP-ENV:encodingStyle=&quot;' </span>. <span class="src-var">$encodingStyle </span>. <span class="src-str">'&quot;'</span><span class="src-sym">;</span></li>
<li><a name="a5880"></a>        <span class="src-sym">}</span></li>
<li><a name="a5881"></a>&nbsp;</li>
<li><a name="a5882"></a>        <span class="src-comm">// if a soapval has been supplied, let its type override the WSDL</span></li>
<li><a name="a5883"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>== <span class="src-str">'soapval'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5884"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">type_ns</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5885"></a>                <span class="src-var">$type </span>= <span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">type_ns </span>. <span class="src-str">':' </span>. <span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">type</span><span class="src-sym">;</span></li>
<li><a name="a5886"></a>                <span class="src-var">$forceType </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a5887"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: soapval overrides type to <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5888"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">type</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5889"></a>                <span class="src-var">$type </span>= <span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">type</span><span class="src-sym">;</span></li>
<li><a name="a5890"></a>                <span class="src-var">$forceType </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a5891"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: soapval overrides type to <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5892"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5893"></a>                <span class="src-var">$forceType </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5894"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in serializeType: soapval does not override type&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5895"></a>            <span class="src-sym">}</span></li>
<li><a name="a5896"></a>            <span class="src-var">$attrs </span>= <span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">attributes</span><span class="src-sym">;</span></li>
<li><a name="a5897"></a>            <span class="src-var">$value </span>= <span class="src-var">$value</span><span class="src-sym">-&gt;</span><span class="src-id">value</span><span class="src-sym">;</span></li>
<li><a name="a5898"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: soapval overrides value to <span class="src-var">$value</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5899"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5900"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5901"></a>                    <span class="src-var">$value</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a5902"></a>                <span class="src-sym">}</span></li>
<li><a name="a5903"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5904"></a>                    <span class="src-var">$value</span><span class="src-sym">[</span><span class="src-str">'!' </span>. <span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a5905"></a>                <span class="src-sym">}</span></li>
<li><a name="a5906"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in serializeType: soapval provides attributes&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5907"></a>            <span class="src-sym">}</span></li>
<li><a name="a5908"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5909"></a>            <span class="src-var">$forceType </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a5910"></a>        <span class="src-sym">}</span></li>
<li><a name="a5911"></a>&nbsp;</li>
<li><a name="a5912"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5913"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5914"></a>            <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">) </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5915"></a>            <span class="src-var">$ns </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a5916"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: got a prefixed type: <span class="src-var">$uqType</span>, <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5917"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5918"></a>                <span class="src-var">$ns </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5919"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: expanded prefixed type: <span class="src-var">$uqType</span>, <span class="src-var">$ns</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5920"></a>            <span class="src-sym">}</span></li>
<li><a name="a5921"></a>&nbsp;</li>
<li><a name="a5922"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ns </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a> || <span class="src-var">$ns </span>== <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a5923"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in serializeType: type namespace indicates XML Schema or SOAP Encoding type'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5924"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$unqualified </span>&amp;&amp; <span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5925"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot; xmlns=\&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5926"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5927"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5928"></a>                <span class="src-sym">}</span></li>
<li><a name="a5929"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5930"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5931"></a>                        <span class="src-comm">// TODO: depends on minOccurs</span></li>
<li><a name="a5932"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span>/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5933"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5934"></a>                        <span class="src-comm">// TODO: depends on nillable, which should be checked before calling this method</span></li>
<li><a name="a5935"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:nil=\&quot;true\&quot; xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5936"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5937"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5938"></a>                    <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a5939"></a>                <span class="src-sym">}</span></li>
<li><a name="a5940"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$uqType </span>== <span class="src-str">'Array'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5941"></a>                    <span class="src-comm">// JBoss/Axis does this sometimes</span></li>
<li><a name="a5942"></a>                    <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5943"></a>                <span class="src-sym">}</span></li>
<li><a name="a5944"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$uqType </span>== <span class="src-str">'boolean'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5945"></a>                    <span class="src-key">if </span><span class="src-sym">((</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$value </span>== <span class="src-str">'false'</span><span class="src-sym">) </span>|| <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5946"></a>                        <span class="src-var">$value </span>= <span class="src-str">'false'</span><span class="src-sym">;</span></li>
<li><a name="a5947"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5948"></a>                        <span class="src-var">$value </span>= <span class="src-str">'true'</span><span class="src-sym">;</span></li>
<li><a name="a5949"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5950"></a>                <span class="src-sym">} </span></li>
<li><a name="a5951"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$uqType </span>== <span class="src-str">'string' </span>&amp;&amp; <a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>== <span class="src-str">'string'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5952"></a>                    <span class="src-var">$value </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5953"></a>                <span class="src-sym">}</span></li>
<li><a name="a5954"></a>                <span class="src-key">if </span><span class="src-sym">((</span><span class="src-var">$uqType </span>== <span class="src-str">'long' </span>|| <span class="src-var">$uqType </span>== <span class="src-str">'unsignedLong'</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>== <span class="src-str">'double'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5955"></a>                    <span class="src-var">$value </span>= <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">&quot;%.0lf&quot;</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5956"></a>                <span class="src-sym">}</span></li>
<li><a name="a5957"></a>                <span class="src-comm">// it's a scalar</span></li>
<li><a name="a5958"></a>                <span class="src-comm">// TODO: what about null/nil values?</span></li>
<li><a name="a5959"></a>                <span class="src-comm">// check type isn't a custom type extending xmlschema namespace</span></li>
<li><a name="a5960"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a5961"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5962"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$forceType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5963"></a>                            <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5964"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5965"></a>                            <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span>&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5966"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5967"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5968"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;<span class="src-var">$encodingStyle</span>&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5969"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5970"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5971"></a>                    <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a5972"></a>                <span class="src-sym">}</span></li>
<li><a name="a5973"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'custom type extends XML Schema or SOAP Encoding namespace (yuck)'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5974"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$ns </span>== <span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5975"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in serializeType: appears to be Apache SOAP type'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5976"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$uqType </span>== <span class="src-str">'Map'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5977"></a>                    <span class="src-var">$tt_prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5978"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$tt_prefix</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5979"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in serializeType: Add namespace for Apache SOAP type'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5980"></a>                        <span class="src-var">$tt_prefix </span>= <span class="src-str">'ns' </span>. <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">, </span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5981"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$tt_prefix</span><span class="src-sym">] </span>= <span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">;</span></li>
<li><a name="a5982"></a>                        <span class="src-comm">// force this to be added to usedNamespaces</span></li>
<li><a name="a5983"></a>                        <span class="src-var">$tt_prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5984"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5985"></a>                    <span class="src-var">$contents </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a5986"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$value </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5987"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing map element: key <span class="src-var">$k</span>, value <span class="src-var">$v</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5988"></a>                        <span class="src-var">$contents </span>.= <span class="src-str">'&lt;item&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5989"></a>                        <span class="src-var">$contents </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">'key'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5990"></a>                        <span class="src-var">$contents </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a5991"></a>                        <span class="src-var">$contents </span>.= <span class="src-str">'&lt;/item&gt;'</span><span class="src-sym">;</span></li>
<li><a name="a5992"></a>                    <span class="src-sym">}</span></li>
<li><a name="a5993"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5994"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$forceType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a5995"></a>                            <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$tt_prefix </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;&gt;<span class="src-var">$contents</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5996"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a5997"></a>                            <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name</span>&gt;<span class="src-var">$contents</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a5998"></a>                        <span class="src-sym">}</span></li>
<li><a name="a5999"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6000"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$tt_prefix </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;<span class="src-var">$encodingStyle</span>&gt;<span class="src-var">$contents</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6001"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6002"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6003"></a>                    <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6004"></a>                <span class="src-sym">}</span></li>
<li><a name="a6005"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in serializeType: Apache SOAP type, but only support Map'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6006"></a>            <span class="src-sym">}</span></li>
<li><a name="a6007"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6008"></a>            <span class="src-comm">// TODO: should the type be compared to types in XSD, and the namespace</span></li>
<li><a name="a6009"></a>            <span class="src-comm">// set to XSD if the type matches?</span></li>
<li><a name="a6010"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: No namespace for type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6011"></a>            <span class="src-var">$ns </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6012"></a>            <span class="src-var">$uqType </span>= <span class="src-var">$type</span><span class="src-sym">;</span></li>
<li><a name="a6013"></a>        <span class="src-sym">}</span></li>
<li><a name="a6014"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$typeDef </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6015"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$type</span> (<span class="src-var">$uqType</span>) is not a supported type.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6016"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: <span class="src-var">$type</span> (<span class="src-var">$uqType</span>) is not a supported type.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6017"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a6018"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6019"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in serializeType: found typeDef&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6020"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'typeDef=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6021"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">'^'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6022"></a>                <span class="src-var">$uqType </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6023"></a>            <span class="src-sym">}</span></li>
<li><a name="a6024"></a>        <span class="src-sym">}</span></li>
<li><a name="a6025"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6026"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$type</span> (<span class="src-var">$uqType</span>) has no phpType.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6027"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: <span class="src-var">$type</span> (<span class="src-var">$uqType</span>) has no phpType.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6028"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a6029"></a>        <span class="src-sym">}</span></li>
<li><a name="a6030"></a>        <span class="src-var">$phpType </span>= <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'phpType'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6031"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: uqType: <span class="src-var">$uqType</span>, ns: <span class="src-var">$ns</span>, phptype: <span class="src-var">$phpType</span>, arrayType: </span><span class="src-str">&quot; </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">) )</span><span class="src-sym">; </span></li>
<li><a name="a6032"></a>        <span class="src-comm">// if php type == struct, map value to the &lt;all&gt; element names</span></li>
<li><a name="a6033"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$phpType </span>== <span class="src-str">'struct'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6034"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'typeClass'</span><span class="src-sym">] </span>== <span class="src-str">'element'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6035"></a>                <span class="src-var">$elementName </span>= <span class="src-var">$uqType</span><span class="src-sym">;</span></li>
<li><a name="a6036"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>== <span class="src-str">'qualified'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6037"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot;</span><span class="src-str"> xmlns=\&quot;<span class="src-var">$ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6038"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6039"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot; xmlns=\&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6040"></a>                <span class="src-sym">}</span></li>
<li><a name="a6041"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6042"></a>                <span class="src-var">$elementName </span>= <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a6043"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$unqualified</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6044"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot; xmlns=\&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6045"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6046"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6047"></a>                <span class="src-sym">}</span></li>
<li><a name="a6048"></a>            <span class="src-sym">}</span></li>
<li><a name="a6049"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6050"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6051"></a>                    <span class="src-comm">// TODO: depends on minOccurs and nillable</span></li>
<li><a name="a6052"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$elementName$elementNS</span>/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6053"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6054"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$elementName$elementNS</span> xsi:nil=\&quot;true\&quot; xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6055"></a>                <span class="src-sym">}</span></li>
<li><a name="a6056"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6057"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6058"></a>            <span class="src-sym">}</span></li>
<li><a name="a6059"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6060"></a>                <span class="src-var">$value </span>= <a href="http://www.php.net/get_object_vars">get_object_vars</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6061"></a>            <span class="src-sym">}</span></li>
<li><a name="a6062"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6063"></a>                <span class="src-var">$elementAttrs </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeComplexTypeAttributes">serializeComplexTypeAttributes</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">, </span><span class="src-var">$uqType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6064"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6065"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$forceType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6066"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$elementName$elementNS$elementAttrs</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6067"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6068"></a>                        <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$elementName$elementNS$elementAttrs</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6069"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6070"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6071"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$elementName$elementNS$elementAttrs</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;<span class="src-var">$encodingStyle</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6072"></a>                <span class="src-sym">}</span></li>
<li><a name="a6073"></a>&nbsp;</li>
<li><a name="a6074"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'simpleContent'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'simpleContent'</span><span class="src-sym">] </span>== <span class="src-str">'true'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6075"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6076"></a>                        <span class="src-var">$xml </span>.= <span class="src-var">$value</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6077"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: serialized simpleContent for type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6078"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6079"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: no simpleContent to serialize for type <span class="src-var">$type</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6080"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6081"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6082"></a>                    <span class="src-comm">// complexContent</span></li>
<li><a name="a6083"></a>                    <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeComplexTypeElements">serializeComplexTypeElements</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">, </span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6084"></a>                <span class="src-sym">}</span></li>
<li><a name="a6085"></a>                <span class="src-var">$xml </span>.= <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$elementName</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6086"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6087"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;in serializeType: phpType is struct, but value is not an array&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6088"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">&quot;phpType is struct, but value is not an array: see debug output for details&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6089"></a>                <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6090"></a>            <span class="src-sym">}</span></li>
<li><a name="a6091"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$phpType </span>== <span class="src-str">'array'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6092"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>== <span class="src-str">'qualified'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6093"></a>                <span class="src-var">$elementNS </span>= <span class="src-str">&quot;</span><span class="src-str"> xmlns=\&quot;<span class="src-var">$ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6094"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6095"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$unqualified</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6096"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot; xmlns=\&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6097"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6098"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6099"></a>                <span class="src-sym">}</span></li>
<li><a name="a6100"></a>            <span class="src-sym">}</span></li>
<li><a name="a6101"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6102"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6103"></a>                    <span class="src-comm">// TODO: depends on minOccurs</span></li>
<li><a name="a6104"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span>/&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6105"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6106"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:nil=\&quot;true\&quot; xsi:type=\&quot;</span><span class="src-str">&quot; </span>.</li>
<li><a name="a6107"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">) </span>.</li>
<li><a name="a6108"></a>                        <span class="src-str">&quot;:Array\&quot; &quot; </span>.</li>
<li><a name="a6109"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">) </span>.</li>
<li><a name="a6110"></a>                        <span class="src-str">':arrayType=&quot;' </span>.</li>
<li><a name="a6111"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span>.</li>
<li><a name="a6112"></a>                        <span class="src-str">':' </span>.</li>
<li><a name="a6113"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;[0]\&quot;/&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6114"></a>                <span class="src-sym">}</span></li>
<li><a name="a6115"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6116"></a>                <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6117"></a>            <span class="src-sym">}</span></li>
<li><a name="a6118"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'multidimensional'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6119"></a>                <span class="src-var">$nv </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6120"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$value </span><span class="src-key">as </span><span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6121"></a>                    <span class="src-var">$cols </span>= <span class="src-str">',' </span>. <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6122"></a>                    <span class="src-var">$nv </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$nv</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6123"></a>                <span class="src-sym">} </span></li>
<li><a name="a6124"></a>                <span class="src-var">$value </span>= <span class="src-var">$nv</span><span class="src-sym">;</span></li>
<li><a name="a6125"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6126"></a>                <span class="src-var">$cols </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6127"></a>            <span class="src-sym">} </span></li>
<li><a name="a6128"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>&gt;= <span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6129"></a>                <span class="src-var">$rows </span>= <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6130"></a>                <span class="src-var">$contents </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6131"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$value </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6132"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing array element: <span class="src-var">$k</span>, <span class="src-var">$v</span> of type: <span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-id">arrayType</span><span class="src-sym">]</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6133"></a>                    <span class="src-comm">//if (strpos($typeDef['arrayType'], ':') ) {</span></li>
<li><a name="a6134"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$typemap">typemap</a><span class="src-sym">[</span><span class="src-str">'http://www.w3.org/2001/XMLSchema'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6135"></a>                        <span class="src-var">$contents </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-str">'item'</span><span class="src-sym">, </span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6136"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6137"></a>                        <span class="src-var">$contents </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-str">'item'</span><span class="src-sym">, </span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6138"></a>                    <span class="src-sym">} </span></li>
<li><a name="a6139"></a>                <span class="src-sym">}</span></li>
<li><a name="a6140"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6141"></a>                <span class="src-var">$rows </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a6142"></a>                <span class="src-var">$contents </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a6143"></a>            <span class="src-sym">}</span></li>
<li><a name="a6144"></a>            <span class="src-comm">// TODO: for now, an empty value will be serialized as a zero element</span></li>
<li><a name="a6145"></a>            <span class="src-comm">// array.  Revisit this when coding the handling of null/nil values.</span></li>
<li><a name="a6146"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6147"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span>&gt;</span><span class="src-str">&quot;</span></li>
<li><a name="a6148"></a>                    .<span class="src-var">$contents</span></li>
<li><a name="a6149"></a>                    .<span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6150"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6151"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:type=\&quot;</span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">)</span>.<span class="src-str">':Array&quot; '</span>.</li>
<li><a name="a6152"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">)</span></li>
<li><a name="a6153"></a>                    .<span class="src-str">':arrayType=&quot;'</span></li>
<li><a name="a6154"></a>                    .<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">))</span></li>
<li><a name="a6155"></a>                    .<span class="src-str">&quot;:&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;</span><span class="src-str">[<span class="src-var">$rows$cols</span>]\&quot;&gt;</span><span class="src-str">&quot;</span></li>
<li><a name="a6156"></a>                    .<span class="src-var">$contents</span></li>
<li><a name="a6157"></a>                    .<span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6158"></a>            <span class="src-sym">}</span></li>
<li><a name="a6159"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$phpType </span>== <span class="src-str">'scalar'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6160"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>== <span class="src-str">'qualified'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6161"></a>                <span class="src-var">$elementNS </span>= <span class="src-str">&quot;</span><span class="src-str"> xmlns=\&quot;<span class="src-var">$ns</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6162"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6163"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$unqualified</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6164"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">&quot; xmlns=\&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6165"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6166"></a>                    <span class="src-var">$elementNS </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6167"></a>                <span class="src-sym">}</span></li>
<li><a name="a6168"></a>            <span class="src-sym">}</span></li>
<li><a name="a6169"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6170"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$forceType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6171"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6172"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6173"></a>                    <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span>&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6174"></a>                <span class="src-sym">}</span></li>
<li><a name="a6175"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6176"></a>                <span class="src-var">$xml </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$name$elementNS</span> xsi:type=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefixFromNamespace">getPrefixFromNamespace</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">:<span class="src-var">$uqType</span>\&quot;<span class="src-var">$encodingStyle</span>&gt;<span class="src-var">$value</span>&lt;/<span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6177"></a>            <span class="src-sym">}</span></li>
<li><a name="a6178"></a>        <span class="src-sym">}</span></li>
<li><a name="a6179"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeType: returning: <span class="src-var">$xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6180"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6181"></a>    <span class="src-sym">}</span></li>
<li><a name="a6182"></a>    </li>
<li><a name="a6183"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6184"></a><span class="src-doc">     * serializes the attributes for a complexType</span></li>
<li><a name="a6185"></a><span class="src-doc">     *</span></li>
<li><a name="a6186"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$typeDef </span><span class="src-doc">our internal representation of an XML schema type (or element)</span></li>
<li><a name="a6187"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">a native PHP value (parameter value)</span></li>
<li><a name="a6188"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$ns </span><span class="src-doc">the namespace of the type</span></li>
<li><a name="a6189"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$uqType </span><span class="src-doc">the local part of the type</span></li>
<li><a name="a6190"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">value serialized as an XML string</span></li>
<li><a name="a6191"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a6192"></a><span class="src-doc">     */</span></li>
<li><a name="a6193"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserializeComplexTypeAttributes">serializeComplexTypeAttributes</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">, </span><span class="src-var">$uqType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6194"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializeComplexTypeAttributes for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6195"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6196"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6197"></a>            <span class="src-var">$nsx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6198"></a>            <span class="src-var">$uqTypex </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6199"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$nsx</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6200"></a>                <span class="src-var">$nsx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$nsx</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6201"></a>            <span class="src-sym">}</span></li>
<li><a name="a6202"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$typeDefx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqTypex</span><span class="src-sym">, </span><span class="src-var">$nsx</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6203"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize attributes for extension base <span class="src-var">$nsx</span>:<span class="src-var">$uqTypex</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6204"></a>                <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeComplexTypeAttributes">serializeComplexTypeAttributes</a><span class="src-sym">(</span><span class="src-var">$typeDefx</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$nsx</span><span class="src-sym">, </span><span class="src-var">$uqTypex</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6205"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6206"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">extension base <span class="src-var">$nsx</span>:<span class="src-var">$uqTypex</span> is not a supported type</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6207"></a>            <span class="src-sym">}</span></li>
<li><a name="a6208"></a>        <span class="src-sym">}</span></li>
<li><a name="a6209"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6210"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize attributes for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6211"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6212"></a>                <span class="src-var">$xvalue </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6213"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6214"></a>                <span class="src-var">$xvalue </span>= <a href="http://www.php.net/get_object_vars">get_object_vars</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6215"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6216"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">value is neither an array nor an object for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6217"></a>                <span class="src-var">$xvalue </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6218"></a>            <span class="src-sym">}</span></li>
<li><a name="a6219"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$aName </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6220"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-str">'!' </span>. <span class="src-var">$aName</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6221"></a>                    <span class="src-var">$xname </span>= <span class="src-str">'!' </span>. <span class="src-var">$aName</span><span class="src-sym">;</span></li>
<li><a name="a6222"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">value provided for attribute <span class="src-var">$aName</span> with key <span class="src-var">$xname</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6223"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$aName</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6224"></a>                    <span class="src-var">$xname </span>= <span class="src-var">$aName</span><span class="src-sym">;</span></li>
<li><a name="a6225"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">value provided for attribute <span class="src-var">$aName</span> with key <span class="src-var">$xname</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6226"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'default'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6227"></a>                    <span class="src-var">$xname </span>= <span class="src-str">'!' </span>. <span class="src-var">$aName</span><span class="src-sym">;</span></li>
<li><a name="a6228"></a>                    <span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$xname</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'default'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6229"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'use default value of ' </span>. <span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$aName</span><span class="src-sym">] </span>. <span class="src-str">' for attribute ' </span>. <span class="src-var">$aName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6230"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6231"></a>                    <span class="src-var">$xname </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6232"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">no value provided for attribute <span class="src-var">$aName</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6233"></a>                <span class="src-sym">}</span></li>
<li><a name="a6234"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$xname</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6235"></a>                    <span class="src-var">$xml </span>.=  <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$aName</span>=\&quot;</span><span class="src-str">&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandEntities">expandEntities</a><span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$xname</span><span class="src-sym">]</span><span class="src-sym">) </span>. <span class="src-str">&quot;\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6236"></a>                <span class="src-sym">}</span></li>
<li><a name="a6237"></a>            <span class="src-sym">} </span></li>
<li><a name="a6238"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6239"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">no attributes to serialize for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6240"></a>        <span class="src-sym">}</span></li>
<li><a name="a6241"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6242"></a>    <span class="src-sym">}</span></li>
<li><a name="a6243"></a>&nbsp;</li>
<li><a name="a6244"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6245"></a><span class="src-doc">     * serializes the elements for a complexType</span></li>
<li><a name="a6246"></a><span class="src-doc">     *</span></li>
<li><a name="a6247"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$typeDef </span><span class="src-doc">our internal representation of an XML schema type (or element)</span></li>
<li><a name="a6248"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">a native PHP value (parameter value)</span></li>
<li><a name="a6249"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$ns </span><span class="src-doc">the namespace of the type</span></li>
<li><a name="a6250"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$uqType </span><span class="src-doc">the local part of the type</span></li>
<li><a name="a6251"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$use </span><span class="src-doc">use for part (encoded|literal)</span></li>
<li><a name="a6252"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$encodingStyle </span><span class="src-doc">SOAP encoding style for the value (if different than the enclosing style)</span></li>
<li><a name="a6253"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">value serialized as an XML string</span></li>
<li><a name="a6254"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a6255"></a><span class="src-doc">     */</span></li>
<li><a name="a6256"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodserializeComplexTypeElements">serializeComplexTypeElements</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$ns</span><span class="src-sym">, </span><span class="src-var">$uqType</span><span class="src-sym">, </span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span>=<span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6257"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeComplexTypeElements for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6258"></a>        <span class="src-var">$xml </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6259"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6260"></a>            <span class="src-var">$nsx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6261"></a>            <span class="src-var">$uqTypex </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'extensionBase'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6262"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$nsx</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6263"></a>                <span class="src-var">$nsx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$nsx</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6264"></a>            <span class="src-sym">}</span></li>
<li><a name="a6265"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$typeDefx </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodgetTypeDef">getTypeDef</a><span class="src-sym">(</span><span class="src-var">$uqTypex</span><span class="src-sym">, </span><span class="src-var">$nsx</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6266"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serialize elements for extension base <span class="src-var">$nsx</span>:<span class="src-var">$uqTypex</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6267"></a>                <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeComplexTypeElements">serializeComplexTypeElements</a><span class="src-sym">(</span><span class="src-var">$typeDefx</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$nsx</span><span class="src-sym">, </span><span class="src-var">$uqTypex</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6268"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6269"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">extension base <span class="src-var">$nsx</span>:<span class="src-var">$uqTypex</span> is not a supported type</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6270"></a>            <span class="src-sym">}</span></li>
<li><a name="a6271"></a>        <span class="src-sym">}</span></li>
<li><a name="a6272"></a>        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6273"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in serializeComplexTypeElements, serialize elements for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6274"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6275"></a>                <span class="src-var">$xvalue </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6276"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6277"></a>                <span class="src-var">$xvalue </span>= <a href="http://www.php.net/get_object_vars">get_object_vars</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6278"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6279"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">value is neither an array nor an object for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6280"></a>                <span class="src-var">$xvalue </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6281"></a>            <span class="src-sym">}</span></li>
<li><a name="a6282"></a>            <span class="src-comm">// toggle whether all elements are present - ideally should validate against schema</span></li>
<li><a name="a6283"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">]</span><span class="src-sym">) </span>!= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6284"></a>                <span class="src-var">$optionals </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a6285"></a>            <span class="src-sym">}</span></li>
<li><a name="a6286"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$typeDef</span><span class="src-sym">[</span><span class="src-str">'elements'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$eName </span>=&gt; <span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6287"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6288"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'default'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6289"></a>                        <span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'default'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6290"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'use default value of ' </span>. <span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">] </span>. <span class="src-str">' for element ' </span>. <span class="src-var">$eName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6291"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6292"></a>                <span class="src-sym">}</span></li>
<li><a name="a6293"></a>                <span class="src-comm">// if user took advantage of a minOccurs=0, then only serialize named parameters</span></li>
<li><a name="a6294"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$optionals</span><span class="src-sym">)</span></li>
<li><a name="a6295"></a>                    &amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">]</span><span class="src-sym">)) </span></li>
<li><a name="a6296"></a>                    &amp;&amp; <span class="src-sym">( (</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'nillable'</span><span class="src-sym">]</span><span class="src-sym">)) </span>|| <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'nillable'</span><span class="src-sym">] </span>!= <span class="src-str">'true'</span><span class="src-sym">)</span></li>
<li><a name="a6297"></a>                    <span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6298"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'minOccurs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'minOccurs'</span><span class="src-sym">] </span>&lt;&gt; <span class="src-str">'0'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6299"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">apparent error: no value provided for element <span class="src-var">$eName</span> with minOccurs=</span><span class="src-str">&quot; </span>. <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'minOccurs'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6300"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6301"></a>                    <span class="src-comm">// do nothing</span></li>
<li><a name="a6302"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">no value provided for complexType element <span class="src-var">$eName</span> and element is not nillable, so serialize nothing</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6303"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6304"></a>                    <span class="src-comm">// get value</span></li>
<li><a name="a6305"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6306"></a>                        <span class="src-var">$v </span>= <span class="src-var">$xvalue</span><span class="src-sym">[</span><span class="src-var">$eName</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6307"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6308"></a>                        <span class="src-var">$v </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a6309"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6310"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6311"></a>                        <span class="src-var">$unqualified </span>= <span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'form'</span><span class="src-sym">] </span>== <span class="src-str">'unqualified'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6312"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6313"></a>                        <span class="src-var">$unqualified </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a6314"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6315"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'maxOccurs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'maxOccurs'</span><span class="src-sym">] </span>== <span class="src-str">'unbounded' </span>|| <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'maxOccurs'</span><span class="src-sym">] </span>&gt; <span class="src-num">1</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodisArraySimpleOrStruct">isArraySimpleOrStruct</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>== <span class="src-str">'arraySimple'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6316"></a>                        <span class="src-var">$vv </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a6317"></a>                        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$vv </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6318"></a>                            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>|| isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6319"></a>                                <span class="src-comm">// serialize schema-defined type</span></li>
<li><a name="a6320"></a>                                <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$eName</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>: <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span><span class="src-sym">, </span><span class="src-var">$unqualified</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6321"></a>                            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6322"></a>                                <span class="src-comm">// serialize generic type (can this ever really happen?)</span></li>
<li><a name="a6323"></a>                                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">calling serialize_val() for <span class="src-var">$v</span>, <span class="src-var">$eName</span>, false, false, false, false, <span class="src-var">$use</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6324"></a>                                <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$eName</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6325"></a>                            <span class="src-sym">}</span></li>
<li><a name="a6326"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6327"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6328"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'minOccurs'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'minOccurs'</span><span class="src-sym">] </span>== <span class="src-str">'0'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6329"></a>                            <span class="src-comm">// do nothing</span></li>
<li><a name="a6330"></a>                        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'nillable'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'nillable'</span><span class="src-sym">] </span>== <span class="src-str">'true'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6331"></a>                            <span class="src-comm">// TODO: serialize a nil correctly, but for now serialize schema-defined type</span></li>
<li><a name="a6332"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$eName</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>: <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span><span class="src-sym">, </span><span class="src-var">$unqualified</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6333"></a>                        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>|| isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6334"></a>                            <span class="src-comm">// serialize schema-defined type</span></li>
<li><a name="a6335"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodserializeType">serializeType</a><span class="src-sym">(</span><span class="src-var">$eName</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>: <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'ref'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">, </span><span class="src-var">$encodingStyle</span><span class="src-sym">, </span><span class="src-var">$unqualified</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6336"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6337"></a>                            <span class="src-comm">// serialize generic type (can this ever really happen?)</span></li>
<li><a name="a6338"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">calling serialize_val() for <span class="src-var">$v</span>, <span class="src-var">$eName</span>, false, false, false, false, <span class="src-var">$use</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6339"></a>                            <span class="src-var">$xml </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">, </span><span class="src-var">$eName</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6340"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6341"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6342"></a>                <span class="src-sym">}</span></li>
<li><a name="a6343"></a>            <span class="src-sym">} </span></li>
<li><a name="a6344"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6345"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">no elements to serialize for XML Schema type <span class="src-var">$ns</span>:<span class="src-var">$uqType</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6346"></a>        <span class="src-sym">}</span></li>
<li><a name="a6347"></a>        <span class="src-key">return </span><span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6348"></a>    <span class="src-sym">}</span></li>
<li><a name="a6349"></a>&nbsp;</li>
<li><a name="a6350"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6351"></a><span class="src-doc">    * adds an XML Schema complex type to the WSDL types</span></li>
<li><a name="a6352"></a><span class="src-doc">    *</span></li>
<li><a name="a6353"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$name </span></li>
<li><a name="a6354"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$typeClass </span><span class="src-doc">(complexType|simpleType|attribute)</span></li>
<li><a name="a6355"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$phpType </span><span class="src-doc">currently supported are array and struct (php assoc array)</span></li>
<li><a name="a6356"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$compositor </span><span class="src-doc">(all|sequence|choice)</span></li>
<li><a name="a6357"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$restrictionBase </span><span class="src-doc">namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)</span></li>
<li><a name="a6358"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$elements </span><span class="src-doc">e.g. array ( name =&gt; array(name=&gt;'',type=&gt;'') )</span></li>
<li><a name="a6359"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$attrs </span><span class="src-doc">e.g. array(array('ref'=&gt;'SOAP-ENC:arrayType','wsdl:arrayType'=&gt;'xsd:string[]'))</span></li>
<li><a name="a6360"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$arrayType </span><span class="src-doc">as namespace:name (xsd:string)</span></li>
<li><a name="a6361"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a6362"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a6363"></a><span class="src-doc">    */</span></li>
<li><a name="a6364"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodaddComplexType">addComplexType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$typeClass</span>=<span class="src-str">'complexType'</span><span class="src-sym">,</span><span class="src-var">$phpType</span>=<span class="src-str">'array'</span><span class="src-sym">,</span><span class="src-var">$compositor</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$restrictionBase</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$elements</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$attrs</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$arrayType</span>=<span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6365"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$elements</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6366"></a>            <span class="src-var">$eElements </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6367"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$elements </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6368"></a>                <span class="src-comm">// expand each element</span></li>
<li><a name="a6369"></a>                <span class="src-var">$ee </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6370"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$e </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6371"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">) </span>: <span class="src-var">$k</span><span class="src-sym">;</span></li>
<li><a name="a6372"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>: <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a6373"></a>                    <span class="src-var">$ee</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a6374"></a>                <span class="src-sym">}</span></li>
<li><a name="a6375"></a>                <span class="src-var">$eElements</span><span class="src-sym">[</span><span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-var">$ee</span><span class="src-sym">;</span></li>
<li><a name="a6376"></a>            <span class="src-sym">}</span></li>
<li><a name="a6377"></a>            <span class="src-var">$elements </span>= <span class="src-var">$eElements</span><span class="src-sym">;</span></li>
<li><a name="a6378"></a>        <span class="src-sym">}</span></li>
<li><a name="a6379"></a>        </li>
<li><a name="a6380"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6381"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$a</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6382"></a>                <span class="src-comm">// expand each attribute</span></li>
<li><a name="a6383"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$a </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6384"></a>                    <span class="src-var">$k </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$k</span><span class="src-sym">) </span>: <span class="src-var">$k</span><span class="src-sym">;</span></li>
<li><a name="a6385"></a>                    <span class="src-var">$v </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">) </span>: <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a6386"></a>                    <span class="src-var">$aa</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a6387"></a>                <span class="src-sym">}</span></li>
<li><a name="a6388"></a>                <span class="src-var">$eAttrs</span><span class="src-sym">[</span><span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-var">$aa</span><span class="src-sym">;</span></li>
<li><a name="a6389"></a>            <span class="src-sym">}</span></li>
<li><a name="a6390"></a>            <span class="src-var">$attrs </span>= <span class="src-var">$eAttrs</span><span class="src-sym">;</span></li>
<li><a name="a6391"></a>        <span class="src-sym">}</span></li>
<li><a name="a6392"></a>&nbsp;</li>
<li><a name="a6393"></a>        <span class="src-var">$restrictionBase </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$restrictionBase</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$restrictionBase</span><span class="src-sym">) </span>: <span class="src-var">$restrictionBase</span><span class="src-sym">;</span></li>
<li><a name="a6394"></a>        <span class="src-var">$arrayType </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$arrayType</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$arrayType</span><span class="src-sym">) </span>: <span class="src-var">$arrayType</span><span class="src-sym">;</span></li>
<li><a name="a6395"></a>&nbsp;</li>
<li><a name="a6396"></a>        <span class="src-var">$typens </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">] </span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6397"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$typens</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">addComplexType</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$typeClass</span><span class="src-sym">,</span><span class="src-var">$phpType</span><span class="src-sym">,</span><span class="src-var">$compositor</span><span class="src-sym">,</span><span class="src-var">$restrictionBase</span><span class="src-sym">,</span><span class="src-var">$elements</span><span class="src-sym">,</span><span class="src-var">$attrs</span><span class="src-sym">,</span><span class="src-var">$arrayType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6398"></a>    <span class="src-sym">}</span></li>
<li><a name="a6399"></a>&nbsp;</li>
<li><a name="a6400"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6401"></a><span class="src-doc">    * adds an XML Schema simple type to the WSDL types</span></li>
<li><a name="a6402"></a><span class="src-doc">    *</span></li>
<li><a name="a6403"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span></li>
<li><a name="a6404"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$restrictionBase </span><span class="src-doc">namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)</span></li>
<li><a name="a6405"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$typeClass </span><span class="src-doc">(should always be simpleType)</span></li>
<li><a name="a6406"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$phpType </span><span class="src-doc">(should always be scalar)</span></li>
<li><a name="a6407"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$enumeration </span><span class="src-doc">array of values</span></li>
<li><a name="a6408"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a6409"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a6410"></a><span class="src-doc">    */</span></li>
<li><a name="a6411"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodaddSimpleType">addSimpleType</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$restrictionBase</span>=<span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$typeClass</span>=<span class="src-str">'simpleType'</span><span class="src-sym">, </span><span class="src-var">$phpType</span>=<span class="src-str">'scalar'</span><span class="src-sym">, </span><span class="src-var">$enumeration</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6412"></a>        <span class="src-var">$restrictionBase </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$restrictionBase</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodexpandQname">expandQname</a><span class="src-sym">(</span><span class="src-var">$restrictionBase</span><span class="src-sym">) </span>: <span class="src-var">$restrictionBase</span><span class="src-sym">;</span></li>
<li><a name="a6413"></a>&nbsp;</li>
<li><a name="a6414"></a>        <span class="src-var">$typens </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">] </span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6415"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$typens</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">addSimpleType</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$restrictionBase</span><span class="src-sym">, </span><span class="src-var">$typeClass</span><span class="src-sym">, </span><span class="src-var">$phpType</span><span class="src-sym">, </span><span class="src-var">$enumeration</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6416"></a>    <span class="src-sym">}</span></li>
<li><a name="a6417"></a>&nbsp;</li>
<li><a name="a6418"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6419"></a><span class="src-doc">    * adds an element to the WSDL types</span></li>
<li><a name="a6420"></a><span class="src-doc">    *</span></li>
<li><a name="a6421"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$attrs </span><span class="src-doc">attributes that must include name and type</span></li>
<li><a name="a6422"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> nusoap_xmlschema</span></li>
<li><a name="a6423"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a6424"></a><span class="src-doc">    */</span></li>
<li><a name="a6425"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodaddElement">addElement</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6426"></a>        <span class="src-var">$typens </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'types'</span><span class="src-sym">] </span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'tns'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6427"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$schemas">schemas</a><span class="src-sym">[</span><span class="src-var">$typens</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">addElement</span><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6428"></a>    <span class="src-sym">}</span></li>
<li><a name="a6429"></a>&nbsp;</li>
<li><a name="a6430"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6431"></a><span class="src-doc">    * register an operation with the server</span></li>
<li><a name="a6432"></a><span class="src-doc">    * </span></li>
<li><a name="a6433"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">operation (method) name</span></li>
<li><a name="a6434"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$in </span><span class="src-doc">assoc array of input values: key = param name, value = param type</span></li>
<li><a name="a6435"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$out </span><span class="src-doc">assoc array of output values: key = param name, value = param type</span></li>
<li><a name="a6436"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$namespace </span><span class="src-doc">optional The namespace for the operation</span></li>
<li><a name="a6437"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapaction </span><span class="src-doc">optional The soapaction for the operation</span></li>
<li><a name="a6438"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$style </span><span class="src-doc">(rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically</span></li>
<li><a name="a6439"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$use </span><span class="src-doc">(encoded|literal) optional The use for the parameters (cannot mix right now)</span></li>
<li><a name="a6440"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$documentation </span><span class="src-doc">optional The description to include in the WSDL</span></li>
<li><a name="a6441"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$encodingStyle </span><span class="src-doc">optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)</span></li>
<li><a name="a6442"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a6443"></a><span class="src-doc">    */</span></li>
<li><a name="a6444"></a>    <span class="src-key">function </span><a href="../nusoap/wsdl.html#methodaddOperation">addOperation</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$in </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$out </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$namespace </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$soapaction </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$style </span>= <span class="src-str">'rpc'</span><span class="src-sym">, </span><span class="src-var">$use </span>= <span class="src-str">'encoded'</span><span class="src-sym">, </span><span class="src-var">$documentation </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$encodingStyle </span>= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6445"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'encoded' </span>&amp;&amp; <span class="src-var">$encodingStyle </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6446"></a>            <span class="src-var">$encodingStyle </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">;</span></li>
<li><a name="a6447"></a>        <span class="src-sym">}</span></li>
<li><a name="a6448"></a>&nbsp;</li>
<li><a name="a6449"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$style </span>== <span class="src-str">'document'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6450"></a>            <span class="src-var">$elements </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6451"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$in </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$t</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6452"></a>                <span class="src-var">$elements</span><span class="src-sym">[</span><span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$n</span><span class="src-sym">, </span><span class="src-str">'type' </span>=&gt; <span class="src-var">$t</span><span class="src-sym">, </span><span class="src-str">'form' </span>=&gt; <span class="src-str">'unqualified'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6453"></a>            <span class="src-sym">}</span></li>
<li><a name="a6454"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodaddComplexType">addComplexType</a><span class="src-sym">(</span><span class="src-var">$name </span>. <span class="src-str">'RequestType'</span><span class="src-sym">, </span><span class="src-str">'complexType'</span><span class="src-sym">, </span><span class="src-str">'struct'</span><span class="src-sym">, </span><span class="src-str">'all'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$elements</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6455"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodaddElement">addElement</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$name</span><span class="src-sym">, </span><span class="src-str">'type' </span>=&gt; <span class="src-var">$name </span>. <span class="src-str">'RequestType'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6456"></a>            <span class="src-var">$in </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'parameters' </span>=&gt; <span class="src-str">'tns:' </span>. <span class="src-var">$name </span>. <span class="src-str">'^'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6457"></a>&nbsp;</li>
<li><a name="a6458"></a>            <span class="src-var">$elements </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6459"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$out </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$t</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6460"></a>                <span class="src-var">$elements</span><span class="src-sym">[</span><span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$n</span><span class="src-sym">, </span><span class="src-str">'type' </span>=&gt; <span class="src-var">$t</span><span class="src-sym">, </span><span class="src-str">'form' </span>=&gt; <span class="src-str">'unqualified'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6461"></a>            <span class="src-sym">}</span></li>
<li><a name="a6462"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodaddComplexType">addComplexType</a><span class="src-sym">(</span><span class="src-var">$name </span>. <span class="src-str">'ResponseType'</span><span class="src-sym">, </span><span class="src-str">'complexType'</span><span class="src-sym">, </span><span class="src-str">'struct'</span><span class="src-sym">, </span><span class="src-str">'all'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$elements</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6463"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#methodaddElement">addElement</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$name </span>. <span class="src-str">'Response'</span><span class="src-sym">, </span><span class="src-str">'type' </span>=&gt; <span class="src-var">$name </span>. <span class="src-str">'ResponseType'</span><span class="src-sym">, </span><span class="src-str">'form' </span>=&gt; <span class="src-str">'qualified'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6464"></a>            <span class="src-var">$out </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'parameters' </span>=&gt; <span class="src-str">'tns:' </span>. <span class="src-var">$name </span>. <span class="src-str">'Response' </span>. <span class="src-str">'^'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6465"></a>        <span class="src-sym">}</span></li>
<li><a name="a6466"></a>&nbsp;</li>
<li><a name="a6467"></a>        <span class="src-comm">// get binding</span></li>
<li><a name="a6468"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$bindings">bindings</a><span class="src-sym">[ </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName </span>. <span class="src-str">'Binding' </span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'operations'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">] </span>=</li>
<li><a name="a6469"></a>        <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a6470"></a>        <span class="src-str">'name' </span>=&gt; <span class="src-var">$name</span><span class="src-sym">,</span></li>
<li><a name="a6471"></a>        <span class="src-str">'binding' </span>=&gt; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">serviceName </span>. <span class="src-str">'Binding'</span><span class="src-sym">,</span></li>
<li><a name="a6472"></a>        <span class="src-str">'endpoint' </span>=&gt; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$endpoint">endpoint</a><span class="src-sym">,</span></li>
<li><a name="a6473"></a>        <span class="src-str">'soapAction' </span>=&gt; <span class="src-var">$soapaction</span><span class="src-sym">,</span></li>
<li><a name="a6474"></a>        <span class="src-str">'style' </span>=&gt; <span class="src-var">$style</span><span class="src-sym">,</span></li>
<li><a name="a6475"></a>        <span class="src-str">'input' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a6476"></a>            <span class="src-str">'use' </span>=&gt; <span class="src-var">$use</span><span class="src-sym">,</span></li>
<li><a name="a6477"></a>            <span class="src-str">'namespace' </span>=&gt; <span class="src-var">$namespace</span><span class="src-sym">,</span></li>
<li><a name="a6478"></a>            <span class="src-str">'encodingStyle' </span>=&gt; <span class="src-var">$encodingStyle</span><span class="src-sym">,</span></li>
<li><a name="a6479"></a>            <span class="src-str">'message' </span>=&gt; <span class="src-var">$name </span>. <span class="src-str">'Request'</span><span class="src-sym">,</span></li>
<li><a name="a6480"></a>            <span class="src-str">'parts' </span>=&gt; <span class="src-var">$in</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a6481"></a>        <span class="src-str">'output' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a6482"></a>            <span class="src-str">'use' </span>=&gt; <span class="src-var">$use</span><span class="src-sym">,</span></li>
<li><a name="a6483"></a>            <span class="src-str">'namespace' </span>=&gt; <span class="src-var">$namespace</span><span class="src-sym">,</span></li>
<li><a name="a6484"></a>            <span class="src-str">'encodingStyle' </span>=&gt; <span class="src-var">$encodingStyle</span><span class="src-sym">,</span></li>
<li><a name="a6485"></a>            <span class="src-str">'message' </span>=&gt; <span class="src-var">$name </span>. <span class="src-str">'Response'</span><span class="src-sym">,</span></li>
<li><a name="a6486"></a>            <span class="src-str">'parts' </span>=&gt; <span class="src-var">$out</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a6487"></a>        <span class="src-str">'namespace' </span>=&gt; <span class="src-var">$namespace</span><span class="src-sym">,</span></li>
<li><a name="a6488"></a>        <span class="src-str">'transport' </span>=&gt; <span class="src-str">'http://schemas.xmlsoap.org/soap/http'</span><span class="src-sym">,</span></li>
<li><a name="a6489"></a>        <span class="src-str">'documentation' </span>=&gt; <span class="src-var">$documentation</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a6490"></a>        <span class="src-comm">// add portTypes</span></li>
<li><a name="a6491"></a>        <span class="src-comm">// add messages</span></li>
<li><a name="a6492"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$in</span><span class="src-sym">)</span></li>
<li><a name="a6493"></a>        <span class="src-sym">{</span></li>
<li><a name="a6494"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$in </span><span class="src-key">as </span><span class="src-var">$pName </span>=&gt; <span class="src-var">$pType</span><span class="src-sym">)</span></li>
<li><a name="a6495"></a>            <span class="src-sym">{</span></li>
<li><a name="a6496"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6497"></a>                    <span class="src-var">$pType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">))</span>.<span class="src-str">&quot;:&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6498"></a>                <span class="src-sym">}</span></li>
<li><a name="a6499"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$name</span>.<span class="src-str">'Request'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$pName</span><span class="src-sym">] </span>= <span class="src-var">$pType</span><span class="src-sym">;</span></li>
<li><a name="a6500"></a>            <span class="src-sym">}</span></li>
<li><a name="a6501"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6502"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$name</span>.<span class="src-str">'Request'</span><span class="src-sym">]</span>= <span class="src-str">'0'</span><span class="src-sym">;</span></li>
<li><a name="a6503"></a>        <span class="src-sym">}</span></li>
<li><a name="a6504"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$out</span><span class="src-sym">)</span></li>
<li><a name="a6505"></a>        <span class="src-sym">{</span></li>
<li><a name="a6506"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$out </span><span class="src-key">as </span><span class="src-var">$pName </span>=&gt; <span class="src-var">$pType</span><span class="src-sym">)</span></li>
<li><a name="a6507"></a>            <span class="src-sym">{</span></li>
<li><a name="a6508"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6509"></a>                    <span class="src-var">$pType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetNamespaceFromPrefix">getNamespaceFromPrefix</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">))</span>.<span class="src-str">&quot;:&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$pType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6510"></a>                <span class="src-sym">}</span></li>
<li><a name="a6511"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$name</span>.<span class="src-str">'Response'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$pName</span><span class="src-sym">] </span>= <span class="src-var">$pType</span><span class="src-sym">;</span></li>
<li><a name="a6512"></a>            <span class="src-sym">}</span></li>
<li><a name="a6513"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6514"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/wsdl.html#var$messages">messages</a><span class="src-sym">[</span><span class="src-var">$name</span>.<span class="src-str">'Response'</span><span class="src-sym">]</span>= <span class="src-str">'0'</span><span class="src-sym">;</span></li>
<li><a name="a6515"></a>        <span class="src-sym">}</span></li>
<li><a name="a6516"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a6517"></a>    <span class="src-sym">} </span></li>
<li><a name="a6518"></a><span class="src-sym">}</span></li>
<li><a name="a6519"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a6520"></a>&nbsp;</li>
<li><a name="a6521"></a>&nbsp;</li>
<li><a name="a6522"></a>&nbsp;</li>
<li><a name="a6523"></a><span class="src-doc">/**</span></li>
<li><a name="a6524"></a><span class="src-doc">*</span></li>
<li><a name="a6525"></a><span class="src-doc">* nusoap_parser class parses SOAP XML messages into native PHP values</span></li>
<li><a name="a6526"></a><span class="src-doc">*</span></li>
<li><a name="a6527"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a6528"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a6529"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a6530"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6531"></a><span class="src-doc">*/</span></li>
<li><a name="a6532"></a><span class="src-key">class </span><a href="../nusoap/nusoap_parser.html">nusoap_parser</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a> <span class="src-sym">{</span></li>
<li><a name="a6533"></a>&nbsp;</li>
<li><a name="a6534"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$xml">$xml</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6535"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$xml_encoding">$xml_encoding</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6536"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$method">$method</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6537"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$root_struct">$root_struct</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6538"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">$root_struct_name</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6539"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$root_struct_namespace">$root_struct_namespace</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6540"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$root_header">$root_header</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6541"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$document">$document</a> = <span class="src-str">''</span><span class="src-sym">;            </span><span class="src-comm">// incoming SOAP body (text)</span></li>
<li><a name="a6542"></a>    <span class="src-comm">// determines where in the message we are (envelope,header,body,method)</span></li>
<li><a name="a6542"></a>    </li>
<li><a name="a6543"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$status">$status</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6544"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$position">$position</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a6545"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$depth">$depth</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a6546"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$default_namespace">$default_namespace</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6547"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$namespaces">$namespaces</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6548"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$message">$message</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6549"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$parent">$parent</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6550"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$fault">$fault</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a6551"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$fault_code">$fault_code</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6552"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$fault_str">$fault_str</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6553"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$fault_detail">$fault_detail</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6554"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$depth_array">$depth_array</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6555"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$debug_flag">$debug_flag</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a6556"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$soapresponse">$soapresponse</a> = <span class="src-id">NULL</span><span class="src-sym">;    </span><span class="src-comm">// parsed SOAP Body</span></li>
<li><a name="a6556"></a>    </li>
<li><a name="a6557"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$soapheader">$soapheader</a> = <span class="src-id">NULL</span><span class="src-sym">;        </span><span class="src-comm">// parsed SOAP Header</span></li>
<li><a name="a6557"></a>    </li>
<li><a name="a6558"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$responseHeaders">$responseHeaders</a> = <span class="src-str">''</span><span class="src-sym">;    </span><span class="src-comm">// incoming SOAP headers (text)</span></li>
<li><a name="a6558"></a>    </li>
<li><a name="a6559"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$body_position">$body_position</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a6560"></a>    <span class="src-comm">// for multiref parsing:</span></li>
<li><a name="a6561"></a>    <span class="src-comm">// array of id =&gt; pos</span></li>
<li><a name="a6561"></a>    </li>
<li><a name="a6562"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$ids">$ids</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6563"></a>    <span class="src-comm">// array of id =&gt; hrefs =&gt; pos</span></li>
<li><a name="a6563"></a>    </li>
<li><a name="a6564"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$multirefs">$multirefs</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6565"></a>    <span class="src-comm">// toggle for auto-decoding element content</span></li>
<li><a name="a6565"></a>    </li>
<li><a name="a6566"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_parser.html#var$decode_utf8">$decode_utf8</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a6567"></a>&nbsp;</li>
<li><a name="a6568"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6569"></a><span class="src-doc">    * constructor that actually does the parsing</span></li>
<li><a name="a6570"></a><span class="src-doc">    *</span></li>
<li><a name="a6571"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$xml </span><span class="src-doc">SOAP message</span></li>
<li><a name="a6572"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$encoding </span><span class="src-doc">character encoding scheme of message</span></li>
<li><a name="a6573"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$method </span><span class="src-doc">method for which XML is parsed (unused?)</span></li>
<li><a name="a6574"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$decode_utf8 </span><span class="src-doc">whether to decode UTF-8 to ISO-8859-1</span></li>
<li><a name="a6575"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6576"></a><span class="src-doc">    */</span></li>
<li><a name="a6577"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodnusoap_parser">nusoap_parser</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">,</span><span class="src-var">$encoding</span>=<span class="src-str">'UTF-8'</span><span class="src-sym">,</span><span class="src-var">$method</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$decode_utf8</span>=<span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6578"></a>        <span class="src-id"><a href="../nusoap/nusoap_parser.html#var$parent">parent</a></span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6579"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$xml">xml</a> = <span class="src-var">$xml</span><span class="src-sym">;</span></li>
<li><a name="a6580"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$xml_encoding">xml_encoding</a> = <span class="src-var">$encoding</span><span class="src-sym">;</span></li>
<li><a name="a6581"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$method">method</a> = <span class="src-var">$method</span><span class="src-sym">;</span></li>
<li><a name="a6582"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$decode_utf8">decode_utf8</a> = <span class="src-var">$decode_utf8</span><span class="src-sym">;</span></li>
<li><a name="a6583"></a>&nbsp;</li>
<li><a name="a6584"></a>        <span class="src-comm">// Check whether content has been read.</span></li>
<li><a name="a6585"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6586"></a>            <span class="src-comm">// Check XML encoding</span></li>
<li><a name="a6587"></a>            <span class="src-var">$pos_xml </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">, </span><span class="src-str">'&lt;?xml'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6588"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos_xml </span>!== <span class="src-id">FALSE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6589"></a>                <span class="src-var">$xml_decl </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">, </span><span class="src-var">$pos_xml</span><span class="src-sym">, </span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">, </span><span class="src-str">'?&gt;'</span><span class="src-sym">, </span><span class="src-var">$pos_xml </span>+ <span class="src-num">2</span><span class="src-sym">) </span>- <span class="src-var">$pos_xml </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6590"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">&quot;/encoding=[\&quot;']([^\&quot;']*)[\&quot;']/&quot;</span><span class="src-sym">, </span><span class="src-var">$xml_decl</span><span class="src-sym">, </span><span class="src-var">$res</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6591"></a>                    <span class="src-var">$xml_encoding </span>= <span class="src-var">$res</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6592"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$xml_encoding</span><span class="src-sym">) </span>!= <span class="src-var">$encoding</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6593"></a>                        <span class="src-var">$err </span>= <span class="src-str">&quot;Charset from HTTP Content-Type '&quot; </span>. <span class="src-var">$encoding </span>. <span class="src-str">&quot;' does not match encoding from XML declaration '&quot; </span>. <span class="src-var">$xml_encoding </span>. <span class="src-str">&quot;'&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6594"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6595"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$encoding </span>!= <span class="src-str">'ISO-8859-1' </span>|| <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$xml_encoding</span><span class="src-sym">) </span>!= <span class="src-str">'UTF-8'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6596"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6597"></a>                            <span class="src-key">return</span><span class="src-sym">;</span></li>
<li><a name="a6598"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6599"></a>                        <span class="src-comm">// when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed</span></li>
<li><a name="a6600"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6601"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Charset from HTTP Content-Type matches encoding from XML declaration'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6602"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6603"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6604"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'No encoding specified in XML declaration'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6605"></a>                <span class="src-sym">}</span></li>
<li><a name="a6606"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6607"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'No XML declaration'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6608"></a>            <span class="src-sym">}</span></li>
<li><a name="a6609"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Entering nusoap_parser(), length='</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span>.<span class="src-str">', encoding='</span>.<span class="src-var">$encoding</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6610"></a>            <span class="src-comm">// Create an XML parser - why not xml_parser_create_ns?</span></li>
<li><a name="a6611"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser </span>= <a href="http://www.php.net/xml_parser_create">xml_parser_create</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$xml_encoding">xml_encoding</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6612"></a>            <span class="src-comm">// Set the options for parsing the XML data.</span></li>
<li><a name="a6613"></a>            <span class="src-comm">//xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);</span></li>
<li><a name="a6614"></a>            <a href="http://www.php.net/xml_parser_set_option">xml_parser_set_option</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">, </span><span class="src-id">XML_OPTION_CASE_FOLDING</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6615"></a>            <a href="http://www.php.net/xml_parser_set_option">xml_parser_set_option</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">, </span><span class="src-id">XML_OPTION_TARGET_ENCODING</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$xml_encoding">xml_encoding</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6616"></a>            <span class="src-comm">// Set the object for the parser.</span></li>
<li><a name="a6617"></a>            <a href="http://www.php.net/xml_set_object">xml_set_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6618"></a>            <span class="src-comm">// Set the element handlers for the parser.</span></li>
<li><a name="a6619"></a>            <a href="http://www.php.net/xml_set_element_handler">xml_set_element_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">, </span><span class="src-str">'start_element'</span><span class="src-sym">,</span><span class="src-str">'end_element'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6620"></a>            <a href="http://www.php.net/xml_set_character_data_handler">xml_set_character_data_handler</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">,</span><span class="src-str">'character_data'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6621"></a>&nbsp;</li>
<li><a name="a6622"></a>            <span class="src-comm">// Parse the XML file.</span></li>
<li><a name="a6623"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/xml_parse">xml_parse</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">,</span><span class="src-var">$xml</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6624"></a>                <span class="src-comm">// Display an error message.</span></li>
<li><a name="a6625"></a>                <span class="src-var">$err </span>= <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'XML error parsing SOAP payload on line %d: %s'</span><span class="src-sym">,</span></li>
<li><a name="a6626"></a>                <a href="http://www.php.net/xml_get_current_line_number">xml_get_current_line_number</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a6627"></a>                <a href="http://www.php.net/xml_error_string">xml_error_string</a><span class="src-sym">(</span><a href="http://www.php.net/xml_get_error_code">xml_get_error_code</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a6628"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6629"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;XML payload:\n&quot; </span>. <span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6630"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6631"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6632"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in nusoap_parser ctor, message:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6633"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6634"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'parsed successfully, found root struct: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a>.<span class="src-str">' of name '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6635"></a>                <span class="src-comm">// get final value</span></li>
<li><a name="a6636"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$soapresponse">soapresponse</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6637"></a>                <span class="src-comm">// get header value</span></li>
<li><a name="a6638"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a> != <span class="src-str">'' </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6639"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$soapheader">soapheader</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6640"></a>                <span class="src-sym">}</span></li>
<li><a name="a6641"></a>                <span class="src-comm">// resolve hrefs/ids</span></li>
<li><a name="a6642"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$multirefs">multirefs</a><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6643"></a>                    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$multirefs">multirefs</a> <span class="src-key">as </span><span class="src-var">$id </span>=&gt; <span class="src-var">$hrefs</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6644"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'resolving multirefs for id: '</span>.<span class="src-var">$id</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6645"></a>                        <span class="src-var">$idVal </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methodbuildVal">buildVal</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$ids">ids</a><span class="src-sym">[</span><span class="src-var">$id</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6646"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$idVal</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$idVal</span><span class="src-sym">[</span><span class="src-str">'!id'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6647"></a>                            unset<span class="src-sym">(</span><span class="src-var">$idVal</span><span class="src-sym">[</span><span class="src-str">'!id'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6648"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6649"></a>                        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$hrefs </span><span class="src-key">as </span><span class="src-var">$refPos </span>=&gt; <span class="src-var">$ref</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6650"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'resolving href at pos '</span>.<span class="src-var">$refPos</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6651"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$multirefs">multirefs</a><span class="src-sym">[</span><span class="src-var">$id</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$refPos</span><span class="src-sym">] </span>= <span class="src-var">$idVal</span><span class="src-sym">;</span></li>
<li><a name="a6652"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6653"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6654"></a>                <span class="src-sym">}</span></li>
<li><a name="a6655"></a>            <span class="src-sym">}</span></li>
<li><a name="a6656"></a>            <a href="http://www.php.net/xml_parser_free">xml_parser_free</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parser</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6657"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6658"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'xml was empty, didn\'t parse!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6659"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'xml was empty, didn\'t parse!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6660"></a>        <span class="src-sym">}</span></li>
<li><a name="a6661"></a>    <span class="src-sym">}</span></li>
<li><a name="a6662"></a>&nbsp;</li>
<li><a name="a6663"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6664"></a><span class="src-doc">    * start-element handler</span></li>
<li><a name="a6665"></a><span class="src-doc">    *</span></li>
<li><a name="a6666"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">resource </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a6667"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a6668"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$attrs </span><span class="src-doc">associative array of attributes</span></li>
<li><a name="a6669"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a6670"></a><span class="src-doc">    */</span></li>
<li><a name="a6671"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodstart_element">start_element</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attrs</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6672"></a>        <span class="src-comm">// position in a total number of elements, starting from 0</span></li>
<li><a name="a6673"></a>        <span class="src-comm">// update class level pos</span></li>
<li><a name="a6674"></a>        <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$position">position</a>++<span class="src-sym">;</span></li>
<li><a name="a6675"></a>        <span class="src-comm">// and set mine</span></li>
<li><a name="a6676"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pos' </span>=&gt; <span class="src-var">$pos</span><span class="src-sym">,</span><span class="src-str">'children'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'cdata'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6677"></a>        <span class="src-comm">// depth = how many levels removed from root?</span></li>
<li><a name="a6678"></a>        <span class="src-comm">// set mine as current global depth and increment global depth value</span></li>
<li><a name="a6679"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'depth'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth">depth</a>++<span class="src-sym">;</span></li>
<li><a name="a6680"></a>&nbsp;</li>
<li><a name="a6681"></a>        <span class="src-comm">// else add self as child to whoever the current parent is</span></li>
<li><a name="a6682"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$pos </span>!= <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6683"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$parent">parent</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'children'</span><span class="src-sym">] </span>.= <span class="src-str">'|'</span>.<span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6684"></a>        <span class="src-sym">}</span></li>
<li><a name="a6685"></a>        <span class="src-comm">// set my parent</span></li>
<li><a name="a6686"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$parent">parent</a><span class="src-sym">;</span></li>
<li><a name="a6687"></a>        <span class="src-comm">// set self as current parent</span></li>
<li><a name="a6688"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$parent">parent</a> = <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6689"></a>        <span class="src-comm">// set self as current value for this depth</span></li>
<li><a name="a6690"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth">depth</a><span class="src-sym">] </span>= <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6691"></a>        <span class="src-comm">// get element prefix</span></li>
<li><a name="a6692"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6693"></a>            <span class="src-comm">// get ns prefix</span></li>
<li><a name="a6694"></a>            <span class="src-var">$prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6695"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a6696"></a>            <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6697"></a>        <span class="src-sym">}</span></li>
<li><a name="a6698"></a>        <span class="src-comm">// set status</span></li>
<li><a name="a6699"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Envelope' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6700"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'envelope'</span><span class="src-sym">;</span></li>
<li><a name="a6701"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Header' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'envelope'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6702"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a> = <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6703"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'header'</span><span class="src-sym">;</span></li>
<li><a name="a6704"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Body' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'envelope'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6705"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'body'</span><span class="src-sym">;</span></li>
<li><a name="a6706"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$body_position">body_position</a> = <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6707"></a>        <span class="src-comm">// set method</span></li>
<li><a name="a6708"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'body' </span>&amp;&amp; <span class="src-var">$pos </span>== <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$body_position">body_position</a>+<span class="src-num">1</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6709"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'method'</span><span class="src-sym">;</span></li>
<li><a name="a6710"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a> = <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a6711"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a> = <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6712"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-str">'struct'</span><span class="src-sym">;</span></li>
<li><a name="a6713"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">found root struct <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a>, pos <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6714"></a>        <span class="src-sym">}</span></li>
<li><a name="a6715"></a>        <span class="src-comm">// set my status</span></li>
<li><a name="a6716"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'status'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a><span class="src-sym">;</span></li>
<li><a name="a6717"></a>        <span class="src-comm">// set name</span></li>
<li><a name="a6718"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">] </span>= <a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6719"></a>        <span class="src-comm">// set attrs</span></li>
<li><a name="a6720"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">;</span></li>
<li><a name="a6721"></a>&nbsp;</li>
<li><a name="a6722"></a>        <span class="src-comm">// loop through atts, logging ns and type declarations</span></li>
<li><a name="a6723"></a>        <span class="src-var">$attstr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6724"></a>        <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$attrs </span><span class="src-key">as </span><span class="src-var">$key </span>=&gt; <span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6725"></a>            <span class="src-var">$key_prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6726"></a>            <span class="src-var">$key_localpart </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6727"></a>            <span class="src-comm">// if ns declarations, add to class level array of valid namespaces</span></li>
<li><a name="a6728"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$key_prefix </span>== <span class="src-str">'xmlns'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6729"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^http:\/\/www.w3.org\/[0-9]{4}\/XMLSchema$/'</span><span class="src-sym">,</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6730"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a> = <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6731"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsd'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a><span class="src-sym">;</span></li>
<li><a name="a6732"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-str">'xsi'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$XMLSchemaVersion">XMLSchemaVersion</a>.<span class="src-str">'-instance'</span><span class="src-sym">;</span></li>
<li><a name="a6733"></a>                <span class="src-sym">}</span></li>
<li><a name="a6734"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$key_localpart</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6735"></a>                <span class="src-comm">// set method namespace</span></li>
<li><a name="a6736"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6737"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">methodNamespace </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6738"></a>                <span class="src-sym">}</span></li>
<li><a name="a6739"></a>            <span class="src-comm">// if it's a type declaration, set type</span></li>
<li><a name="a6740"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$key_localpart </span>== <span class="src-str">'type'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6741"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6742"></a>                    <span class="src-comm">// do nothing: already processed arrayType</span></li>
<li><a name="a6743"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6744"></a>                    <span class="src-var">$value_prefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetPrefix">getPrefix</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6745"></a>                    <span class="src-var">$value_localpart </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetLocalPart">getLocalPart</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6746"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-var">$value_localpart</span><span class="src-sym">;</span></li>
<li><a name="a6747"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'typePrefix'</span><span class="src-sym">] </span>= <span class="src-var">$value_prefix</span><span class="src-sym">;</span></li>
<li><a name="a6748"></a>                    <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$value_prefix</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6749"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$value_prefix</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6750"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'xmlns:'</span>.<span class="src-var">$value_prefix</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6751"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'xmlns:'</span>.<span class="src-var">$value_prefix</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6752"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6753"></a>                    <span class="src-comm">// should do something here with the namespace of specified type?</span></li>
<li><a name="a6754"></a>                <span class="src-sym">}</span></li>
<li><a name="a6755"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$key_localpart </span>== <span class="src-str">'arrayType'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6756"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-str">'array'</span><span class="src-sym">;</span></li>
<li><a name="a6757"></a>                <span class="src-comm">/* do arrayType ereg here</span></li>
<li><a name="a6758"></a><span class="src-comm">                [1]    arrayTypeValue    ::=    atype asize</span></li>
<li><a name="a6759"></a><span class="src-comm">                [2]    atype    ::=    QName rank*</span></li>
<li><a name="a6760"></a><span class="src-comm">                [3]    rank    ::=    '[' (',')* ']'</span></li>
<li><a name="a6761"></a><span class="src-comm">                [4]    asize    ::=    '[' length~ ']'</span></li>
<li><a name="a6762"></a><span class="src-comm">                [5]    length    ::=    nextDimension* Digit+</span></li>
<li><a name="a6763"></a><span class="src-comm">                [6]    nextDimension    ::=    Digit+ ','</span></li>
<li><a name="a6764"></a><span class="src-comm">                */</span></li>
<li><a name="a6765"></a>                <span class="src-var">$expr </span>= <span class="src-str">'/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/'</span><span class="src-sym">;</span></li>
<li><a name="a6766"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$expr</span><span class="src-sym">,</span><span class="src-var">$value</span><span class="src-sym">,</span><span class="src-var">$regs</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6767"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'typePrefix'</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6768"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypePrefix'</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6769"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6770"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">;</span></li>
<li><a name="a6771"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'xmlns:'</span>.<span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6772"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>= <span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'xmlns:'</span>.<span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">;</span></li>
<li><a name="a6773"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6774"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6775"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arraySize'</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6776"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayCols'</span><span class="src-sym">] </span>= <span class="src-var">$regs</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6777"></a>                <span class="src-sym">}</span></li>
<li><a name="a6778"></a>            <span class="src-comm">// specifies nil value (or not)</span></li>
<li><a name="a6779"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$key_localpart </span>== <span class="src-str">'nil'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6780"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nil'</span><span class="src-sym">] </span>= <span class="src-sym">(</span><span class="src-var">$value </span>== <span class="src-str">'true' </span>|| <span class="src-var">$value </span>== <span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6781"></a>            <span class="src-comm">// some other attribute</span></li>
<li><a name="a6782"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$key </span>!= <span class="src-str">'href' </span>&amp;&amp; <span class="src-var">$key </span>!= <span class="src-str">'xmlns' </span>&amp;&amp; <span class="src-var">$key_localpart </span>!= <span class="src-str">'encodingStyle' </span>&amp;&amp; <span class="src-var">$key_localpart </span>!= <span class="src-str">'root'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6783"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!' </span>. <span class="src-var">$key</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6784"></a>            <span class="src-sym">}</span></li>
<li><a name="a6785"></a>&nbsp;</li>
<li><a name="a6786"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$key </span>== <span class="src-str">'xmlns'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6787"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$default_namespace">default_namespace</a> = <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a6788"></a>            <span class="src-sym">}</span></li>
<li><a name="a6789"></a>            <span class="src-comm">// log id</span></li>
<li><a name="a6790"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$key </span>== <span class="src-str">'id'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6791"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$ids">ids</a><span class="src-sym">[</span><span class="src-var">$value</span><span class="src-sym">] </span>= <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6792"></a>            <span class="src-sym">}</span></li>
<li><a name="a6793"></a>            <span class="src-comm">// root</span></li>
<li><a name="a6794"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$key_localpart </span>== <span class="src-str">'root' </span>&amp;&amp; <span class="src-var">$value </span>== <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6795"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'method'</span><span class="src-sym">;</span></li>
<li><a name="a6796"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a> = <span class="src-var">$name</span><span class="src-sym">;</span></li>
<li><a name="a6797"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a> = <span class="src-var">$pos</span><span class="src-sym">;</span></li>
<li><a name="a6798"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">found root struct <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a>, pos <span class="src-var">$pos</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6799"></a>            <span class="src-sym">}</span></li>
<li><a name="a6800"></a>            <span class="src-comm">// for doclit</span></li>
<li><a name="a6801"></a>            <span class="src-var">$attstr </span>.= <span class="src-str">&quot;</span><span class="src-str"> <span class="src-var">$key</span>=\&quot;<span class="src-var">$value</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6802"></a>        <span class="src-sym">}</span></li>
<li><a name="a6803"></a>        <span class="src-comm">// get namespace - must be done after namespace atts are processed</span></li>
<li><a name="a6804"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6805"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6806"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$default_namespace">default_namespace</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$namespaces">namespaces</a><span class="src-sym">[</span><span class="src-var">$prefix</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6807"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6808"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$default_namespace">default_namespace</a><span class="src-sym">;</span></li>
<li><a name="a6809"></a>        <span class="src-sym">}</span></li>
<li><a name="a6810"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'header'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6811"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a> != <span class="src-var">$pos</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6812"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$responseHeaders">responseHeaders</a> .= <span class="src-str">&quot;&lt;&quot; </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span>? <span class="src-var">$prefix </span>. <span class="src-str">':' </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$name$attstr</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6813"></a>            <span class="src-sym">}</span></li>
<li><a name="a6814"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_name">root_struct_name</a> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6815"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$document">document</a> .= <span class="src-str">&quot;&lt;&quot; </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span>? <span class="src-var">$prefix </span>. <span class="src-str">':' </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$name$attstr</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6816"></a>        <span class="src-sym">}</span></li>
<li><a name="a6817"></a>    <span class="src-sym">}</span></li>
<li><a name="a6818"></a>&nbsp;</li>
<li><a name="a6819"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6820"></a><span class="src-doc">    * end-element handler</span></li>
<li><a name="a6821"></a><span class="src-doc">    *</span></li>
<li><a name="a6822"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">resource </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a6823"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">element name</span></li>
<li><a name="a6824"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a6825"></a><span class="src-doc">    */</span></li>
<li><a name="a6826"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodend_element">end_element</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6827"></a>        <span class="src-comm">// position of current element is equal to the last value left in depth_array for my depth</span></li>
<li><a name="a6828"></a>        <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth">depth</a>--<span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6829"></a>&nbsp;</li>
<li><a name="a6830"></a>        <span class="src-comm">// get element prefix</span></li>
<li><a name="a6831"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6832"></a>            <span class="src-comm">// get ns prefix</span></li>
<li><a name="a6833"></a>            <span class="src-var">$prefix </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a6834"></a>            <span class="src-comm">// get unqualified name</span></li>
<li><a name="a6835"></a>            <span class="src-var">$name </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6836"></a>        <span class="src-sym">}</span></li>
<li><a name="a6837"></a>        </li>
<li><a name="a6838"></a>        <span class="src-comm">// build to native type</span></li>
<li><a name="a6839"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$body_position">body_position</a><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$pos </span>&gt; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$body_position">body_position</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6840"></a>            <span class="src-comm">// deal w/ multirefs</span></li>
<li><a name="a6841"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'href'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6842"></a>                <span class="src-comm">// get id</span></li>
<li><a name="a6843"></a>                <span class="src-var">$id </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'attrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'href'</span><span class="src-sym">]</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6844"></a>                <span class="src-comm">// add placeholder to href array</span></li>
<li><a name="a6845"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$multirefs">multirefs</a><span class="src-sym">[</span><span class="src-var">$id</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">] </span>= <span class="src-str">'placeholder'</span><span class="src-sym">;</span></li>
<li><a name="a6846"></a>                <span class="src-comm">// add set a reference to it as the result value</span></li>
<li><a name="a6847"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>=<span class="src-sym">&amp; </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$multirefs">multirefs</a><span class="src-sym">[</span><span class="src-var">$id</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6848"></a>            <span class="src-comm">// build complexType values</span></li>
<li><a name="a6849"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'children'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6850"></a>                <span class="src-comm">// if result has already been generated (struct/array)</span></li>
<li><a name="a6851"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a6852"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methodbuildVal">buildVal</a><span class="src-sym">(</span><span class="src-var">$pos</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6853"></a>                <span class="src-sym">}</span></li>
<li><a name="a6854"></a>            <span class="src-comm">// build complexType values of attributes and possibly simpleContent</span></li>
<li><a name="a6855"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6856"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nil'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nil'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6857"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a6858"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">) </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6859"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6860"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6861"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6862"></a>                        <span class="src-var">$parent </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6863"></a>                        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6864"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6865"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6866"></a>                            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6867"></a>                        <span class="src-sym">}</span></li>
<li><a name="a6868"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6869"></a>                <span class="src-sym">}</span></li>
<li><a name="a6870"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6871"></a>            <span class="src-comm">// set value of simpleType (or nil complexType)</span></li>
<li><a name="a6872"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6873"></a>                <span class="src-comm">//$this-&gt;debug('adding data for scalar value '.$this-&gt;message[$pos]['name'].' of value '.$this-&gt;message[$pos]['cdata']);</span></li>
<li><a name="a6874"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nil'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'nil'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6875"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a6876"></a>                <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6877"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6878"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6879"></a>                    <span class="src-var">$parent </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6880"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a6881"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6882"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6883"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6884"></a>                    <span class="src-sym">}</span></li>
<li><a name="a6885"></a>                <span class="src-sym">}</span></li>
<li><a name="a6886"></a>&nbsp;</li>
<li><a name="a6887"></a>                <span class="src-comm">/* add value to parent's result, if parent is struct/array</span></li>
<li><a name="a6888"></a><span class="src-comm">                $parent = $this-&gt;message[$pos]['parent'];</span></li>
<li><a name="a6889"></a><span class="src-comm">                if($this-&gt;message[$parent]['type'] != 'map'){</span></li>
<li><a name="a6890"></a><span class="src-comm">                    if(strtolower($this-&gt;message[$parent]['type']) == 'array'){</span></li>
<li><a name="a6891"></a><span class="src-comm">                        $this-&gt;message[$parent]['result'][] = $this-&gt;message[$pos]['result'];</span></li>
<li><a name="a6892"></a><span class="src-comm">                    } else {</span></li>
<li><a name="a6893"></a><span class="src-comm">                        $this-&gt;message[$parent]['result'][$this-&gt;message[$pos]['name']] = $this-&gt;message[$pos]['result'];</span></li>
<li><a name="a6894"></a><span class="src-comm">                    }</span></li>
<li><a name="a6895"></a><span class="src-comm">                }</span></li>
<li><a name="a6896"></a><span class="src-comm">                */</span></li>
<li><a name="a6897"></a>            <span class="src-sym">}</span></li>
<li><a name="a6898"></a>        <span class="src-sym">}</span></li>
<li><a name="a6899"></a>        </li>
<li><a name="a6900"></a>        <span class="src-comm">// for doclit</span></li>
<li><a name="a6901"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'header'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6902"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a> != <span class="src-var">$pos</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6903"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$responseHeaders">responseHeaders</a> .= <span class="src-str">&quot;&lt;/&quot; </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span>? <span class="src-var">$prefix </span>. <span class="src-str">':' </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6904"></a>            <span class="src-sym">}</span></li>
<li><a name="a6905"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$pos </span>&gt;= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6906"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$document">document</a> .= <span class="src-str">&quot;&lt;/&quot; </span>. <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">) </span>? <span class="src-var">$prefix </span>. <span class="src-str">':' </span>: <span class="src-str">''</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$name</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a6907"></a>        <span class="src-sym">}</span></li>
<li><a name="a6908"></a>        <span class="src-comm">// switch status</span></li>
<li><a name="a6909"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pos </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct">root_struct</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6910"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'body'</span><span class="src-sym">;</span></li>
<li><a name="a6911"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_struct_namespace">root_struct_namespace</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6912"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$pos </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$root_header">root_header</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6913"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'envelope'</span><span class="src-sym">;</span></li>
<li><a name="a6914"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Body' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'body'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6915"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'envelope'</span><span class="src-sym">;</span></li>
<li><a name="a6916"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Header' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'header'</span><span class="src-sym">) </span><span class="src-sym">{ </span><span class="src-comm">// will never happen</span></li>
<li><a name="a6917"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">'envelope'</span><span class="src-sym">;</span></li>
<li><a name="a6918"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$name </span>== <span class="src-str">'Envelope' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'envelope'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a6919"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a6920"></a>        <span class="src-sym">}</span></li>
<li><a name="a6921"></a>        <span class="src-comm">// set parent back to my parent</span></li>
<li><a name="a6922"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$parent">parent</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6923"></a>    <span class="src-sym">}</span></li>
<li><a name="a6924"></a>&nbsp;</li>
<li><a name="a6925"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6926"></a><span class="src-doc">    * element content handler</span></li>
<li><a name="a6927"></a><span class="src-doc">    *</span></li>
<li><a name="a6928"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">resource </span><span class="src-doc-var">$parser </span><span class="src-doc">XML parser object</span></li>
<li><a name="a6929"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$data </span><span class="src-doc">element content</span></li>
<li><a name="a6930"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a6931"></a><span class="src-doc">    */</span></li>
<li><a name="a6932"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodcharacter_data">character_data</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6933"></a>        <span class="src-var">$pos </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth_array">depth_array</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$depth">depth</a><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a6934"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$xml_encoding">xml_encoding</a>==<span class="src-str">'UTF-8'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6935"></a>            <span class="src-comm">// TODO: add an option to disable this for folks who want</span></li>
<li><a name="a6936"></a>            <span class="src-comm">// raw UTF-8 that, e.g., might not map to iso-8859-1</span></li>
<li><a name="a6937"></a>            <span class="src-comm">// TODO: this can also be handled with xml_parser_set_option($this-&gt;parser, XML_OPTION_TARGET_ENCODING, &quot;ISO-8859-1&quot;);</span></li>
<li><a name="a6938"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$decode_utf8">decode_utf8</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6939"></a>                <span class="src-var">$data </span>= <a href="http://www.php.net/utf8_decode">utf8_decode</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a6940"></a>            <span class="src-sym">}</span></li>
<li><a name="a6941"></a>        <span class="src-sym">}</span></li>
<li><a name="a6942"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">] </span>.= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a6943"></a>        <span class="src-comm">// for doclit</span></li>
<li><a name="a6944"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$status">status</a> == <span class="src-str">'header'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6945"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$responseHeaders">responseHeaders</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a6946"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a6947"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$document">document</a> .= <span class="src-var">$data</span><span class="src-sym">;</span></li>
<li><a name="a6948"></a>        <span class="src-sym">}</span></li>
<li><a name="a6949"></a>    <span class="src-sym">}</span></li>
<li><a name="a6950"></a>&nbsp;</li>
<li><a name="a6951"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6952"></a><span class="src-doc">    * get the parsed message (SOAP Body)</span></li>
<li><a name="a6953"></a><span class="src-doc">    *</span></li>
<li><a name="a6954"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span></li>
<li><a name="a6955"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6956"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span><span class="src-doc">    use get_soapbody instead</span></li>
<li><a name="a6957"></a><span class="src-doc">    */</span></li>
<li><a name="a6958"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodget_response">get_response</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6959"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$soapresponse">soapresponse</a><span class="src-sym">;</span></li>
<li><a name="a6960"></a>    <span class="src-sym">}</span></li>
<li><a name="a6961"></a>&nbsp;</li>
<li><a name="a6962"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6963"></a><span class="src-doc">    * get the parsed SOAP Body (NULL if there was none)</span></li>
<li><a name="a6964"></a><span class="src-doc">    *</span></li>
<li><a name="a6965"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span></li>
<li><a name="a6966"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6967"></a><span class="src-doc">    */</span></li>
<li><a name="a6968"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodget_soapbody">get_soapbody</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6969"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$soapresponse">soapresponse</a><span class="src-sym">;</span></li>
<li><a name="a6970"></a>    <span class="src-sym">}</span></li>
<li><a name="a6971"></a>&nbsp;</li>
<li><a name="a6972"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6973"></a><span class="src-doc">    * get the parsed SOAP Header (NULL if there was none)</span></li>
<li><a name="a6974"></a><span class="src-doc">    *</span></li>
<li><a name="a6975"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span></li>
<li><a name="a6976"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6977"></a><span class="src-doc">    */</span></li>
<li><a name="a6978"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodget_soapheader">get_soapheader</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6979"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$soapheader">soapheader</a><span class="src-sym">;</span></li>
<li><a name="a6980"></a>    <span class="src-sym">}</span></li>
<li><a name="a6981"></a>&nbsp;</li>
<li><a name="a6982"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6983"></a><span class="src-doc">    * get the unparsed SOAP Header</span></li>
<li><a name="a6984"></a><span class="src-doc">    *</span></li>
<li><a name="a6985"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">XML or empty if no Header</span></li>
<li><a name="a6986"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a6987"></a><span class="src-doc">    */</span></li>
<li><a name="a6988"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodgetHeaders">getHeaders</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a6989"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$responseHeaders">responseHeaders</a><span class="src-sym">;</span></li>
<li><a name="a6990"></a>    <span class="src-sym">}</span></li>
<li><a name="a6991"></a>&nbsp;</li>
<li><a name="a6992"></a>    <span class="src-doc">/**</span></li>
<li><a name="a6993"></a><span class="src-doc">    * decodes simple types into PHP variables</span></li>
<li><a name="a6994"></a><span class="src-doc">    *</span></li>
<li><a name="a6995"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$value </span><span class="src-doc">value to decode</span></li>
<li><a name="a6996"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$type </span><span class="src-doc">XML type to decode</span></li>
<li><a name="a6997"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$typens </span><span class="src-doc">XML type namespace to decode</span></li>
<li><a name="a6998"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">PHP value</span></li>
<li><a name="a6999"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7000"></a><span class="src-doc">    */</span></li>
<li><a name="a7001"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">, </span><span class="src-var">$type</span><span class="src-sym">, </span><span class="src-var">$typens</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7002"></a>        <span class="src-comm">// TODO: use the namespace!</span></li>
<li><a name="a7003"></a>        <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)) </span>|| <span class="src-var">$type </span>== <span class="src-str">'string' </span>|| <span class="src-var">$type </span>== <span class="src-str">'long' </span>|| <span class="src-var">$type </span>== <span class="src-str">'unsignedLong'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7004"></a>            <span class="src-key">return </span>(string) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7005"></a>        <span class="src-sym">}</span></li>
<li><a name="a7006"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'int' </span>|| <span class="src-var">$type </span>== <span class="src-str">'integer' </span>|| <span class="src-var">$type </span>== <span class="src-str">'short' </span>|| <span class="src-var">$type </span>== <span class="src-str">'byte'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7007"></a>            <span class="src-key">return </span>(int) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7008"></a>        <span class="src-sym">}</span></li>
<li><a name="a7009"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'float' </span>|| <span class="src-var">$type </span>== <span class="src-str">'double' </span>|| <span class="src-var">$type </span>== <span class="src-str">'decimal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7010"></a>            <span class="src-key">return </span>(double) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7011"></a>        <span class="src-sym">}</span></li>
<li><a name="a7012"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'boolean'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7013"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>== <span class="src-str">'false' </span>|| <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">) </span>== <span class="src-str">'f'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7014"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7015"></a>            <span class="src-sym">}</span></li>
<li><a name="a7016"></a>            <span class="src-key">return </span>(boolean) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7017"></a>        <span class="src-sym">}</span></li>
<li><a name="a7018"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'base64' </span>|| <span class="src-var">$type </span>== <span class="src-str">'base64Binary'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7019"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Decode base64 value'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7020"></a>            <span class="src-key">return </span><a href="http://www.php.net/base64_decode">base64_decode</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7021"></a>        <span class="src-sym">}</span></li>
<li><a name="a7022"></a>        <span class="src-comm">// obscure numeric types</span></li>
<li><a name="a7023"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'nonPositiveInteger' </span>|| <span class="src-var">$type </span>== <span class="src-str">'negativeInteger'</span></li>
<li><a name="a7024"></a>            || <span class="src-var">$type </span>== <span class="src-str">'nonNegativeInteger' </span>|| <span class="src-var">$type </span>== <span class="src-str">'positiveInteger'</span></li>
<li><a name="a7025"></a>            || <span class="src-var">$type </span>== <span class="src-str">'unsignedInt'</span></li>
<li><a name="a7026"></a>            || <span class="src-var">$type </span>== <span class="src-str">'unsignedShort' </span>|| <span class="src-var">$type </span>== <span class="src-str">'unsignedByte'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7027"></a>            <span class="src-key">return </span>(int) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7028"></a>        <span class="src-sym">}</span></li>
<li><a name="a7029"></a>        <span class="src-comm">// bogus: parser treats array with no elements as a simple type</span></li>
<li><a name="a7030"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$type </span>== <span class="src-str">'array'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7031"></a>            <span class="src-key">return </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7032"></a>        <span class="src-sym">}</span></li>
<li><a name="a7033"></a>        <span class="src-comm">// everything else</span></li>
<li><a name="a7034"></a>        <span class="src-key">return </span>(string) <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7035"></a>    <span class="src-sym">}</span></li>
<li><a name="a7036"></a>&nbsp;</li>
<li><a name="a7037"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7038"></a><span class="src-doc">    * builds response structures for compound values (arrays/structs)</span></li>
<li><a name="a7039"></a><span class="src-doc">    * and scalars</span></li>
<li><a name="a7040"></a><span class="src-doc">    *</span></li>
<li><a name="a7041"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$pos </span><span class="src-doc">position in node tree</span></li>
<li><a name="a7042"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   PHP value</span></li>
<li><a name="a7043"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7044"></a><span class="src-doc">    */</span></li>
<li><a name="a7045"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_parser.html#methodbuildVal">buildVal</a><span class="src-sym">(</span><span class="src-var">$pos</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7046"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7047"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7048"></a>        <span class="src-sym">}</span></li>
<li><a name="a7049"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal() for '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">(pos <span class="src-var">$pos</span>) of type </span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7050"></a>        <span class="src-comm">// if there are children...</span></li>
<li><a name="a7051"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'children'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7052"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, there are children'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7053"></a>            <span class="src-var">$children </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'|'</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'children'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7054"></a>            <a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$children</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// knock off empty</span></li>
<li><a name="a7055"></a>            <span class="src-comm">// md array</span></li>
<li><a name="a7056"></a>            <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayCols'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayCols'</span><span class="src-sym">] </span>!= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7057"></a>                <span class="src-var">$r</span>=<span class="src-num">0</span><span class="src-sym">; </span><span class="src-comm">// rowcount</span></li>
<li><a name="a7058"></a>                <span class="src-var">$c</span>=<span class="src-num">0</span><span class="src-sym">; </span><span class="src-comm">// colcount</span></li>
<li><a name="a7059"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$children </span><span class="src-key">as </span><span class="src-var">$child_pos</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7060"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in buildVal, got an MD array element: <span class="src-var">$r</span>, <span class="src-var">$c</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7061"></a>                    <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$r</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7062"></a>                    <span class="src-var">$c</span>++<span class="src-sym">;</span></li>
<li><a name="a7063"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$c </span>== <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayCols'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7064"></a>                        <span class="src-var">$c </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a7065"></a>                        <span class="src-var">$r</span>++<span class="src-sym">;</span></li>
<li><a name="a7066"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7067"></a>                <span class="src-sym">}</span></li>
<li><a name="a7068"></a>            <span class="src-comm">// array</span></li>
<li><a name="a7069"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array' </span>|| <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'Array'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7070"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, adding array '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7071"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$children </span><span class="src-key">as </span><span class="src-var">$child_pos</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7072"></a>                    <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7073"></a>                <span class="src-sym">}</span></li>
<li><a name="a7074"></a>            <span class="src-comm">// apache Map type: java hashtable</span></li>
<li><a name="a7075"></a>            <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'Map' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>== <span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7076"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, Java Map '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7077"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$children </span><span class="src-key">as </span><span class="src-var">$child_pos</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7078"></a>                    <span class="src-var">$kv </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;|&quot;</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'children'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7079"></a>                       <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$kv</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]] </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$kv</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7080"></a>                <span class="src-sym">}</span></li>
<li><a name="a7081"></a>            <span class="src-comm">// generic compound type</span></li>
<li><a name="a7082"></a>            <span class="src-comm">//} elseif($this-&gt;message[$pos]['type'] == 'SOAPStruct' || $this-&gt;message[$pos]['type'] == 'struct') {</span></li>
<li><a name="a7083"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7084"></a>                <span class="src-comm">// Apache Vector type: treat as an array</span></li>
<li><a name="a7085"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, adding Java Vector or generic compound type '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7086"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'Vector' </span>&amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>== <span class="src-str">'http://xml.apache.org/xml-soap'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7087"></a>                    <span class="src-var">$notstruct </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a7088"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7089"></a>                    <span class="src-var">$notstruct </span>= <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a7090"></a>                <span class="src-sym">}</span></li>
<li><a name="a7091"></a>                <span class="src-comm">//</span></li>
<li><a name="a7092"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$children </span><span class="src-key">as </span><span class="src-var">$child_pos</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7093"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$notstruct</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7094"></a>                        <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7095"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7096"></a>                        <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7097"></a>                            <span class="src-comm">// de-serialize repeated element name into an array</span></li>
<li><a name="a7098"></a>                            <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">)) </span>|| <span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a7099"></a>                                <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7100"></a>                            <span class="src-sym">}</span></li>
<li><a name="a7101"></a>                            <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7102"></a>                        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7103"></a>                            <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]] </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$child_pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7104"></a>                        <span class="src-sym">}</span></li>
<li><a name="a7105"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7106"></a>                <span class="src-sym">}</span></li>
<li><a name="a7107"></a>            <span class="src-sym">}</span></li>
<li><a name="a7108"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7109"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, handling attributes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7110"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'xattrs'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$n </span>=&gt; <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7111"></a>                    <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-var">$n</span><span class="src-sym">] </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a7112"></a>                <span class="src-sym">}</span></li>
<li><a name="a7113"></a>            <span class="src-sym">}</span></li>
<li><a name="a7114"></a>            <span class="src-comm">// handle simpleContent</span></li>
<li><a name="a7115"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">) </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7116"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, handling simpleContent'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7117"></a>                <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7118"></a>                    <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7119"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7120"></a>                    <span class="src-var">$parent </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7121"></a>                    <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7122"></a>                        <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7123"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7124"></a>                        <span class="src-var">$params</span><span class="src-sym">[</span><span class="src-str">'!'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7125"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7126"></a>                <span class="src-sym">}</span></li>
<li><a name="a7127"></a>            <span class="src-sym">}</span></li>
<li><a name="a7128"></a>            <span class="src-var">$ret </span>= <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">) </span>? <span class="src-var">$params </span>: <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7129"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, return:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7130"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7131"></a>            <span class="src-key">return </span><span class="src-var">$ret</span><span class="src-sym">;</span></li>
<li><a name="a7132"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7133"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'in buildVal, no children, building scalar'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7134"></a>            <span class="src-var">$cdata </span>= isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7135"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7136"></a>                <span class="src-var">$ret </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$cdata</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type_namespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7137"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in buildVal, return: <span class="src-var">$ret</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7138"></a>                <span class="src-key">return </span><span class="src-var">$ret</span><span class="src-sym">;</span></li>
<li><a name="a7139"></a>            <span class="src-sym">}</span></li>
<li><a name="a7140"></a>            <span class="src-var">$parent </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parent'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7141"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">] </span>== <span class="src-str">'array'</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7142"></a>                <span class="src-var">$ret </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#methoddecodeSimple">decodeSimple</a><span class="src-sym">(</span><span class="src-var">$cdata</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayType'</span><span class="src-sym">]</span><span class="src-sym">, </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$parent</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'arrayTypeNamespace'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7143"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in buildVal, return: <span class="src-var">$ret</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7144"></a>                <span class="src-key">return </span><span class="src-var">$ret</span><span class="src-sym">;</span></li>
<li><a name="a7145"></a>            <span class="src-sym">}</span></li>
<li><a name="a7146"></a>               <span class="src-var">$ret </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_parser.html#var$message">message</a><span class="src-sym">[</span><span class="src-var">$pos</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'cdata'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7147"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in buildVal, return: <span class="src-var">$ret</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7148"></a>               <span class="src-key">return </span><span class="src-var">$ret</span><span class="src-sym">;</span></li>
<li><a name="a7149"></a>        <span class="src-sym">}</span></li>
<li><a name="a7150"></a>    <span class="src-sym">}</span></li>
<li><a name="a7151"></a><span class="src-sym">}</span></li>
<li><a name="a7152"></a>&nbsp;</li>
<li><a name="a7153"></a><span class="src-doc">/**</span></li>
<li><a name="a7154"></a><span class="src-doc"> * Backward compatibility</span></li>
<li><a name="a7155"></a><span class="src-doc"> */</span></li>
<li><a name="a7156"></a><span class="src-key">class </span><a href="../nusoap/soap_parser.html">soap_parser</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_parser.html#methodnusoap_parser">nusoap_parser</a> <span class="src-sym">{</span></li>
<li><a name="a7157"></a><span class="src-sym">}</span></li>
<li><a name="a7158"></a>&nbsp;</li>
<li><a name="a7159"></a><span class="src-php">?&gt;</span><span class="src-php">&lt;?php</span></li>
<li><a name="a7160"></a>&nbsp;</li>
<li><a name="a7161"></a>&nbsp;</li>
<li><a name="a7162"></a>&nbsp;</li>
<li><a name="a7163"></a><span class="src-doc">/**</span></li>
<li><a name="a7164"></a><span class="src-doc">*</span></li>
<li><a name="a7165"></a><span class="src-doc">* [nu]soapclient higher level class for easy usage.</span></li>
<li><a name="a7166"></a><span class="src-doc">*</span></li>
<li><a name="a7167"></a><span class="src-doc">* usage:</span></li>
<li><a name="a7168"></a><span class="src-doc">*</span></li>
<li><a name="a7169"></a><span class="src-doc">* // instantiate client with server info</span></li>
<li><a name="a7170"></a><span class="src-doc">* $soapclient = new nusoap_client( string path [ ,mixed wsdl] );</span></li>
<li><a name="a7171"></a><span class="src-doc">*</span></li>
<li><a name="a7172"></a><span class="src-doc">* // call method, get results</span></li>
<li><a name="a7173"></a><span class="src-doc">* echo $soapclient-&gt;call( string methodname [ ,array parameters] );</span></li>
<li><a name="a7174"></a><span class="src-doc">*</span></li>
<li><a name="a7175"></a><span class="src-doc">* // bye bye client</span></li>
<li><a name="a7176"></a><span class="src-doc">* unset($soapclient);</span></li>
<li><a name="a7177"></a><span class="src-doc">*</span></li>
<li><a name="a7178"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Dietrich Ayala &lt;dietrich@ganx4.com&gt;</span></li>
<li><a name="a7179"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc">   Scott Nichol &lt;snichol@users.sourceforge.net&gt;</span></li>
<li><a name="a7180"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc">  $Id: fsource_nusoap__nusoap.php.html,v 1.2 2010/04/26 20:25:21 snichol Exp $</span></li>
<li><a name="a7181"></a><span class="src-doc">* </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7182"></a><span class="src-doc">*/</span></li>
<li><a name="a7183"></a><span class="src-key">class </span><a href="../nusoap/nusoap_client.html">nusoap_client</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a>  <span class="src-sym">{</span></li>
<li><a name="a7184"></a>&nbsp;</li>
<li><a name="a7185"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$username">$username</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Username for HTTP authentication</span></li>
<li><a name="a7185"></a>    </li>
<li><a name="a7186"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$password">$password</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Password for HTTP authentication</span></li>
<li><a name="a7186"></a>    </li>
<li><a name="a7187"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$authtype">$authtype</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// Type of HTTP authentication</span></li>
<li><a name="a7187"></a>    </li>
<li><a name="a7188"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$certRequest">$certRequest</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;        </span><span class="src-comm">// Certificate for HTTP SSL authentication</span></li>
<li><a name="a7188"></a>    </li>
<li><a name="a7189"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$requestHeaders">$requestHeaders</a> = <span class="src-id">false</span><span class="src-sym">;    </span><span class="src-comm">// SOAP headers in request (text)</span></li>
<li><a name="a7189"></a>    </li>
<li><a name="a7190"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$responseHeaders">$responseHeaders</a> = <span class="src-str">''</span><span class="src-sym">;        </span><span class="src-comm">// SOAP headers from response (incomplete namespace resolution) (text)</span></li>
<li><a name="a7190"></a>    </li>
<li><a name="a7191"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$responseHeader">$responseHeader</a> = <span class="src-id">NULL</span><span class="src-sym">;        </span><span class="src-comm">// SOAP Header from response (parsed)</span></li>
<li><a name="a7191"></a>    </li>
<li><a name="a7192"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$document">$document</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// SOAP body response portion (incomplete namespace resolution) (text)</span></li>
<li><a name="a7192"></a>    </li>
<li><a name="a7193"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$endpoint">$endpoint</a><span class="src-sym">;</span></li>
<li><a name="a7194"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$forceEndpoint">$forceEndpoint</a> = <span class="src-str">''</span><span class="src-sym">;        </span><span class="src-comm">// overrides WSDL endpoint</span></li>
<li><a name="a7194"></a>    </li>
<li><a name="a7195"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$proxyhost">$proxyhost</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7196"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$proxyport">$proxyport</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7197"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$proxyusername">$proxyusername</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7198"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$proxypassword">$proxypassword</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7199"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$portName">$portName</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// port name to use in WSDL</span></li>
<li><a name="a7199"></a>    </li>
<li><a name="a7200"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$xml_encoding">$xml_encoding</a> = <span class="src-str">''</span><span class="src-sym">;            </span><span class="src-comm">// character set encoding of incoming (response) messages</span></li>
<li><a name="a7200"></a>    </li>
<li><a name="a7201"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$http_encoding">$http_encoding</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7202"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$timeout">$timeout</a> = <span class="src-num">0</span><span class="src-sym">;                </span><span class="src-comm">// HTTP connection timeout</span></li>
<li><a name="a7202"></a>    </li>
<li><a name="a7203"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$response_timeout">$response_timeout</a> = <span class="src-num">30</span><span class="src-sym">;        </span><span class="src-comm">// HTTP response timeout</span></li>
<li><a name="a7203"></a>    </li>
<li><a name="a7204"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$endpointType">$endpointType</a> = <span class="src-str">''</span><span class="src-sym">;            </span><span class="src-comm">// soap|wsdl, empty for WSDL initialization error</span></li>
<li><a name="a7204"></a>    </li>
<li><a name="a7205"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$persistentConnection">$persistentConnection</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7206"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$defaultRpcParams">$defaultRpcParams</a> = <span class="src-id">false</span><span class="src-sym">;    </span><span class="src-comm">// This is no longer used</span></li>
<li><a name="a7206"></a>    </li>
<li><a name="a7207"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$request">$request</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// HTTP request</span></li>
<li><a name="a7207"></a>    </li>
<li><a name="a7208"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$response">$response</a> = <span class="src-str">''</span><span class="src-sym">;                </span><span class="src-comm">// HTTP response</span></li>
<li><a name="a7208"></a>    </li>
<li><a name="a7209"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$responseData">$responseData</a> = <span class="src-str">''</span><span class="src-sym">;            </span><span class="src-comm">// SOAP payload of response</span></li>
<li><a name="a7209"></a>    </li>
<li><a name="a7210"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$cookies">$cookies</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;            </span><span class="src-comm">// Cookies from response or for request</span></li>
<li><a name="a7210"></a>    </li>
<li><a name="a7211"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$decode_utf8">$decode_utf8</a> = <span class="src-id">true</span><span class="src-sym">;        </span><span class="src-comm">// toggles whether the parser decodes element content w/ utf8_decode()</span></li>
<li><a name="a7211"></a>    </li>
<li><a name="a7212"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$operations">$operations</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;        </span><span class="src-comm">// WSDL operations, empty for WSDL initialization error</span></li>
<li><a name="a7212"></a>    </li>
<li><a name="a7213"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$curl_options">$curl_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span><span class="src-comm">// User-specified cURL options</span></li>
<li><a name="a7213"></a>    </li>
<li><a name="a7214"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$bindingType">$bindingType</a> = <span class="src-str">''</span><span class="src-sym">;            </span><span class="src-comm">// WSDL operation binding type</span></li>
<li><a name="a7214"></a>    </li>
<li><a name="a7215"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$use_curl">$use_curl</a> = <span class="src-id">false</span><span class="src-sym">;            </span><span class="src-comm">// whether to always try to use cURL</span></li>
<li><a name="a7216"></a>&nbsp;</li>
<li><a name="a7217"></a>    <span class="src-comm">/*</span></li>
<li><a name="a7218"></a><span class="src-comm">     * fault related variables</span></li>
<li><a name="a7219"></a><span class="src-comm">     */</span></li>
<li><a name="a7220"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7221"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">fault </span></li>
<li><a name="a7222"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7223"></a><span class="src-doc">     */</span></li>
<li><a name="a7224"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$fault">$fault</a><span class="src-sym">;</span></li>
<li><a name="a7225"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7226"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">faultcode </span></li>
<li><a name="a7227"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7228"></a><span class="src-doc">     */</span></li>
<li><a name="a7229"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$faultcode">$faultcode</a><span class="src-sym">;</span></li>
<li><a name="a7230"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7231"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">faultstring </span></li>
<li><a name="a7232"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7233"></a><span class="src-doc">     */</span></li>
<li><a name="a7234"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$faultstring">$faultstring</a><span class="src-sym">;</span></li>
<li><a name="a7235"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7236"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@var </span><span class="src-doc">     </span><span class="src-doc-type">faultdetail </span></li>
<li><a name="a7237"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7238"></a><span class="src-doc">     */</span></li>
<li><a name="a7239"></a>    <span class="src-key">var </span><a href="../nusoap/nusoap_client.html#var$faultdetail">$faultdetail</a><span class="src-sym">;</span></li>
<li><a name="a7240"></a>&nbsp;</li>
<li><a name="a7241"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7242"></a><span class="src-doc">    * constructor</span></li>
<li><a name="a7243"></a><span class="src-doc">    *</span></li>
<li><a name="a7244"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$endpoint </span><span class="src-doc">SOAP server or WSDL URL (string), or wsdl instance (object)</span></li>
<li><a name="a7245"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$wsdl </span><span class="src-doc">optional, set to 'wsdl' or true if using WSDL</span></li>
<li><a name="a7246"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyhost </span><span class="src-doc">optional</span></li>
<li><a name="a7247"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyport </span><span class="src-doc">optional</span></li>
<li><a name="a7248"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyusername </span><span class="src-doc">optional</span></li>
<li><a name="a7249"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxypassword </span><span class="src-doc">optional</span></li>
<li><a name="a7250"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set the connection timeout</span></li>
<li><a name="a7251"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set the response timeout</span></li>
<li><a name="a7252"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$portName </span><span class="src-doc">optional portName in WSDL document</span></li>
<li><a name="a7253"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7254"></a><span class="src-doc">    */</span></li>
<li><a name="a7255"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodnusoap_client">nusoap_client</a><span class="src-sym">(</span><span class="src-var">$endpoint</span><span class="src-sym">,</span><span class="src-var">$wsdl </span>= <span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxyhost </span>= <span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxyport </span>= <span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$proxyusername </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$proxypassword </span>= <span class="src-id">false</span><span class="src-sym">, </span><span class="src-var">$timeout </span>= <span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$response_timeout </span>= <span class="src-num">30</span><span class="src-sym">, </span><span class="src-var">$portName </span>= <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7256"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../nusoap/nusoap_base.html#methodnusoap_base">nusoap_base</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7257"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a> = <span class="src-var">$endpoint</span><span class="src-sym">;</span></li>
<li><a name="a7258"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a> = <span class="src-var">$proxyhost</span><span class="src-sym">;</span></li>
<li><a name="a7259"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a> = <span class="src-var">$proxyport</span><span class="src-sym">;</span></li>
<li><a name="a7260"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyusername">proxyusername</a> = <span class="src-var">$proxyusername</span><span class="src-sym">;</span></li>
<li><a name="a7261"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxypassword">proxypassword</a> = <span class="src-var">$proxypassword</span><span class="src-sym">;</span></li>
<li><a name="a7262"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$timeout">timeout</a> = <span class="src-var">$timeout</span><span class="src-sym">;</span></li>
<li><a name="a7263"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response_timeout">response_timeout</a> = <span class="src-var">$response_timeout</span><span class="src-sym">;</span></li>
<li><a name="a7264"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$portName">portName</a> = <span class="src-var">$portName</span><span class="src-sym">;</span></li>
<li><a name="a7265"></a>&nbsp;</li>
<li><a name="a7266"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">ctor wsdl=<span class="src-var">$wsdl</span> timeout=<span class="src-var">$timeout</span> response_timeout=<span class="src-var">$response_timeout</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7267"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'endpoint=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$endpoint</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7268"></a>&nbsp;</li>
<li><a name="a7269"></a>        <span class="src-comm">// make values</span></li>
<li><a name="a7270"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$wsdl</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7271"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$endpoint</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$endpoint</span><span class="src-sym">) </span>== <span class="src-str">'wsdl'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7272"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl </span>= <span class="src-var">$endpoint</span><span class="src-sym">;</span></li>
<li><a name="a7273"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">wsdl</span><span class="src-sym">;</span></li>
<li><a name="a7274"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">;</span></li>
<li><a name="a7275"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'existing wsdl instance created from ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7276"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodcheckWSDL">checkWSDL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7277"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7278"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">;</span></li>
<li><a name="a7279"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl </span>= <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a7280"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'will use lazy evaluation of wsdl from ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7281"></a>            <span class="src-sym">}</span></li>
<li><a name="a7282"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> = <span class="src-str">'wsdl'</span><span class="src-sym">;</span></li>
<li><a name="a7283"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7284"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">instantiate SOAP with endpoint at <span class="src-var">$endpoint</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7285"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> = <span class="src-str">'soap'</span><span class="src-sym">;</span></li>
<li><a name="a7286"></a>        <span class="src-sym">}</span></li>
<li><a name="a7287"></a>    <span class="src-sym">}</span></li>
<li><a name="a7288"></a>&nbsp;</li>
<li><a name="a7289"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7290"></a><span class="src-doc">    * calls method, returns PHP native type</span></li>
<li><a name="a7291"></a><span class="src-doc">    *</span></li>
<li><a name="a7292"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$operation </span><span class="src-doc">SOAP server URL or path</span></li>
<li><a name="a7293"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$params </span><span class="src-doc">An array, associative or simple, of the parameters</span></li>
<li><a name="a7294"></a><span class="src-doc">    *                           for the method call, or a string that is the XML</span></li>
<li><a name="a7295"></a><span class="src-doc">    *                           for the call.  For rpc style, this call will</span></li>
<li><a name="a7296"></a><span class="src-doc">    *                           wrap the XML in a tag named after the method, as</span></li>
<li><a name="a7297"></a><span class="src-doc">    *                           well as the SOAP Envelope and Body.  For document</span></li>
<li><a name="a7298"></a><span class="src-doc">    *                           style, this will only wrap with the Envelope and Body.</span></li>
<li><a name="a7299"></a><span class="src-doc">    *                           IMPORTANT: when using an array with document style,</span></li>
<li><a name="a7300"></a><span class="src-doc">    *                           in which case there</span></li>
<li><a name="a7301"></a><span class="src-doc">    *                          is really one parameter, the root of the fragment</span></li>
<li><a name="a7302"></a><span class="src-doc">    *                          used in the call, which encloses what programmers</span></li>
<li><a name="a7303"></a><span class="src-doc">    *                          normally think of parameters.  A parameter array</span></li>
<li><a name="a7304"></a><span class="src-doc">    *                          *must* include the wrapper.</span></li>
<li><a name="a7305"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$namespace </span><span class="src-doc">optional method namespace (WSDL can override)</span></li>
<li><a name="a7306"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapAction </span><span class="src-doc">optional SOAPAction value (WSDL can override)</span></li>
<li><a name="a7307"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$headers </span><span class="src-doc">optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array</span></li>
<li><a name="a7308"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$rpcParams </span><span class="src-doc">optional (no longer used)</span></li>
<li><a name="a7309"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$style </span><span class="src-doc">optional (rpc|document) the style to use when serializing parameters (WSDL can override)</span></li>
<li><a name="a7310"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$use </span><span class="src-doc">optional (encoded|literal) the use when serializing parameters (WSDL can override)</span></li>
<li><a name="a7311"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   response from SOAP call, normally an associative array mirroring the structure of the XML response, false for certain fatal errors</span></li>
<li><a name="a7312"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7313"></a><span class="src-doc">    */</span></li>
<li><a name="a7314"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodcall">call</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">,</span><span class="src-var">$params</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$namespace</span>=<span class="src-str">'http://tempuri.org'</span><span class="src-sym">,</span><span class="src-var">$soapAction</span>=<span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$headers</span>=<span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$rpcParams</span>=<span class="src-id">null</span><span class="src-sym">,</span><span class="src-var">$style</span>=<span class="src-str">'rpc'</span><span class="src-sym">,</span><span class="src-var">$use</span>=<span class="src-str">'encoded'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7315"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">operation </span>= <span class="src-var">$operation</span><span class="src-sym">;</span></li>
<li><a name="a7316"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$fault">fault</a> = <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7317"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7318"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$request">request</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7319"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response">response</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7320"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseData">responseData</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7321"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$faultstring">faultstring</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7322"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$faultcode">faultcode</a> = <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7323"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7324"></a>        </li>
<li><a name="a7325"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">call: operation=<span class="src-var">$operation</span>, namespace=<span class="src-var">$namespace</span>, soapAction=<span class="src-var">$soapAction</span>, rpcParams=<span class="src-var">$rpcParams</span>, style=<span class="src-var">$style</span>, use=<span class="src-var">$use</span>, endpointType=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7326"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'params=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7327"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'headers=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7328"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7329"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$requestHeaders">requestHeaders</a> = <span class="src-var">$headers</span><span class="src-sym">;</span></li>
<li><a name="a7330"></a>        <span class="src-sym">}</span></li>
<li><a name="a7331"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> == <span class="src-str">'wsdl' </span>&amp;&amp; <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7332"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodloadWSDL">loadWSDL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7333"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">))</span></li>
<li><a name="a7334"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7335"></a>        <span class="src-sym">}</span></li>
<li><a name="a7336"></a>        <span class="src-comm">// serialize parameters</span></li>
<li><a name="a7337"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> == <span class="src-str">'wsdl' </span>&amp;&amp; <span class="src-var">$opData </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodgetOperationData">getOperationData</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7338"></a>            <span class="src-comm">// use WSDL for operation</span></li>
<li><a name="a7339"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">opData </span>= <span class="src-var">$opData</span><span class="src-sym">;</span></li>
<li><a name="a7340"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;found operation&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7341"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'opData=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7342"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7343"></a>                <span class="src-var">$soapAction </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7344"></a>            <span class="src-sym">}</span></li>
<li><a name="a7345"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$forceEndpoint">forceEndpoint</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7346"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a> = <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'endpoint'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7347"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7348"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$forceEndpoint">forceEndpoint</a><span class="src-sym">;</span></li>
<li><a name="a7349"></a>            <span class="src-sym">}</span></li>
<li><a name="a7350"></a>            <span class="src-var">$namespace </span>= isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>:    <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a7351"></a>            <span class="src-var">$style </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7352"></a>            <span class="src-var">$use </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'use'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7353"></a>            <span class="src-comm">// add ns to ns array</span></li>
<li><a name="a7354"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$namespace </span>!= <span class="src-str">'' </span>&amp;&amp; <span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-var">$namespace</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7355"></a>                <span class="src-var">$nsPrefix </span>= <span class="src-str">'ns' </span>. <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">, </span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7356"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">namespaces</span><span class="src-sym">[</span><span class="src-var">$nsPrefix</span><span class="src-sym">] </span>= <span class="src-var">$namespace</span><span class="src-sym">;</span></li>
<li><a name="a7357"></a>            <span class="src-sym">}</span></li>
<li><a name="a7358"></a>            <span class="src-var">$nsPrefix </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getPrefixFromNamespace</span><span class="src-sym">(</span><span class="src-var">$namespace</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7359"></a>            <span class="src-comm">// serialize payload</span></li>
<li><a name="a7360"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7361"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing param string for WSDL operation <span class="src-var">$operation</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7362"></a>                <span class="src-var">$payload </span>= <span class="src-var">$params</span><span class="src-sym">;</span></li>
<li><a name="a7363"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7364"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing param array for WSDL operation <span class="src-var">$operation</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7365"></a>                <span class="src-var">$payload </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">serializeRPCParameters</span><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">,</span><span class="src-str">'input'</span><span class="src-sym">,</span><span class="src-var">$params</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7366"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7367"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'params must be array or string'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7368"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'params must be array or string'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7369"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7370"></a>            <span class="src-sym">}</span></li>
<li><a name="a7371"></a>            <span class="src-var">$usedNamespaces </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">usedNamespaces</span><span class="src-sym">;</span></li>
<li><a name="a7372"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7373"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'encodingStyle'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7374"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7375"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7376"></a>            <span class="src-sym">}</span></li>
<li><a name="a7377"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7378"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7379"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$errstr </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7380"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got wsdl error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7381"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'wsdl error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7382"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7383"></a>            <span class="src-sym">}</span></li>
<li><a name="a7384"></a>        <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> == <span class="src-str">'wsdl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7385"></a>            <span class="src-comm">// operation not in WSDL</span></li>
<li><a name="a7386"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7387"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7388"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'operation '</span>.<span class="src-var">$operation</span>.<span class="src-str">' not present in WSDL.'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7389"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">operation '<span class="src-var">$operation</span>' not present in WSDL.</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7390"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7391"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7392"></a>            <span class="src-comm">// no WSDL</span></li>
<li><a name="a7393"></a>            <span class="src-comm">//$this-&gt;namespaces['ns1'] = $namespace;</span></li>
<li><a name="a7394"></a>            <span class="src-var">$nsPrefix </span>= <span class="src-str">'ns' </span>. <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-num">1000</span><span class="src-sym">, </span><span class="src-num">9999</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7395"></a>            <span class="src-comm">// serialize </span></li>
<li><a name="a7396"></a>            <span class="src-var">$payload </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7397"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7398"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing param string for operation <span class="src-var">$operation</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7399"></a>                <span class="src-var">$payload </span>= <span class="src-var">$params</span><span class="src-sym">;</span></li>
<li><a name="a7400"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$params</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7401"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">serializing param array for operation <span class="src-var">$operation</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7402"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$params </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7403"></a>                    <span class="src-var">$payload </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserialize_val">serialize_val</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-var">$k</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7404"></a>                <span class="src-sym">}</span></li>
<li><a name="a7405"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7406"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'params must be array or string'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7407"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'params must be array or string'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7408"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7409"></a>            <span class="src-sym">}</span></li>
<li><a name="a7410"></a>            <span class="src-var">$usedNamespaces </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7411"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'encoded'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7412"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-str">'http://schemas.xmlsoap.org/soap/encoding/'</span><span class="src-sym">;</span></li>
<li><a name="a7413"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7414"></a>                <span class="src-var">$encodingStyle </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7415"></a>            <span class="src-sym">}</span></li>
<li><a name="a7416"></a>        <span class="src-sym">}</span></li>
<li><a name="a7417"></a>        <span class="src-comm">// wrap RPC calls with method element</span></li>
<li><a name="a7418"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$style </span>== <span class="src-str">'rpc'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7419"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$use </span>== <span class="src-str">'literal'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7420"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;wrapping RPC request with literal method element&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7421"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$namespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7422"></a>                    <span class="src-comm">// http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace</span></li>
<li><a name="a7423"></a>                    <span class="src-var">$payload </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$nsPrefix</span>:<span class="src-var">$operation</span> xmlns:<span class="src-var">$nsPrefix</span>=\&quot;<span class="src-var">$namespace</span>\&quot;&gt;</span><span class="src-str">&quot; </span>.</li>
<li><a name="a7424"></a>                                <span class="src-var">$payload </span>.</li>
<li><a name="a7425"></a>                                <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$nsPrefix</span>:<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7426"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7427"></a>                    <span class="src-var">$payload </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot; </span>. <span class="src-var">$payload </span>. <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7428"></a>                <span class="src-sym">}</span></li>
<li><a name="a7429"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7430"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;wrapping RPC request with encoded method element&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7431"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$namespace</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7432"></a>                    <span class="src-var">$payload </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$nsPrefix</span>:<span class="src-var">$operation</span> xmlns:<span class="src-var">$nsPrefix</span>=\&quot;<span class="src-var">$namespace</span>\&quot;&gt;</span><span class="src-str">&quot; </span>.</li>
<li><a name="a7433"></a>                                <span class="src-var">$payload </span>.</li>
<li><a name="a7434"></a>                                <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$nsPrefix</span>:<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7435"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7436"></a>                    <span class="src-var">$payload </span>= <span class="src-str">&quot;</span><span class="src-str">&lt;<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot; </span>.</li>
<li><a name="a7437"></a>                                <span class="src-var">$payload </span>.</li>
<li><a name="a7438"></a>                                <span class="src-str">&quot;</span><span class="src-str">&lt;/<span class="src-var">$operation</span>&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7439"></a>                <span class="src-sym">}</span></li>
<li><a name="a7440"></a>            <span class="src-sym">}</span></li>
<li><a name="a7441"></a>        <span class="src-sym">}</span></li>
<li><a name="a7442"></a>        <span class="src-comm">// serialize envelope</span></li>
<li><a name="a7443"></a>        <span class="src-var">$soapmsg </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodserializeEnvelope">serializeEnvelope</a><span class="src-sym">(</span><span class="src-var">$payload</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$requestHeaders">requestHeaders</a><span class="src-sym">,</span><span class="src-var">$usedNamespaces</span><span class="src-sym">,</span><span class="src-var">$style</span><span class="src-sym">,</span><span class="src-var">$use</span><span class="src-sym">,</span><span class="src-var">$encodingStyle</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7444"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">endpoint=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a>, soapAction=<span class="src-var">$soapAction</span>, namespace=<span class="src-var">$namespace</span>, style=<span class="src-var">$style</span>, use=<span class="src-var">$use</span>, encodingStyle=<span class="src-var">$encodingStyle</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7445"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'SOAP message length=' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$soapmsg</span><span class="src-sym">) </span>. <span class="src-str">' contents (max 1000 bytes)=' </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$soapmsg</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">1000</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7446"></a>        <span class="src-comm">// send</span></li>
<li><a name="a7447"></a>        <span class="src-var">$return </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodsend">send</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodgetHTTPBody">getHTTPBody</a><span class="src-sym">(</span><span class="src-var">$soapmsg</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$soapAction</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$timeout">timeout</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response_timeout">response_timeout</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7448"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$errstr </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7449"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7450"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7451"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7452"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">return </span>= <span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7453"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'sent message successfully and got a(n) '</span>.<a href="http://www.php.net/gettype">gettype</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7454"></a>               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">'return=' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7455"></a>            </li>
<li><a name="a7456"></a>            <span class="src-comm">// fault?</span></li>
<li><a name="a7457"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">) </span>&amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'faultcode'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7458"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got fault'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7459"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'faultcode'</span><span class="src-sym">]</span>.<span class="src-str">': '</span>.<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'faultstring'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7460"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$fault">fault</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a7461"></a>                <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$return </span><span class="src-key">as </span><span class="src-var">$k </span>=&gt; <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7462"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">$k </span>= <span class="src-var">$v</span><span class="src-sym">;</span></li>
<li><a name="a7463"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$k</span> = <span class="src-var">$v</span>&lt;br&gt;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7464"></a>                <span class="src-sym">}</span></li>
<li><a name="a7465"></a>                <span class="src-key">return </span><span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7466"></a>            <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$style </span>== <span class="src-str">'document'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7467"></a>                <span class="src-comm">// NOTE: if the response is defined to have multiple parts (i.e. unwrapped),</span></li>
<li><a name="a7468"></a>                <span class="src-comm">// we are only going to return the first part here...sorry about that</span></li>
<li><a name="a7469"></a>                <span class="src-key">return </span><span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7470"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7471"></a>                <span class="src-comm">// array of return values</span></li>
<li><a name="a7472"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7473"></a>                    <span class="src-comm">// multiple 'out' parameters, which we return wrapped up</span></li>
<li><a name="a7474"></a>                    <span class="src-comm">// in the array</span></li>
<li><a name="a7475"></a>                    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">) </span>&gt; <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7476"></a>                        <span class="src-key">return </span><span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7477"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7478"></a>                    <span class="src-comm">// single 'out' parameter (normally the return value)</span></li>
<li><a name="a7479"></a>                    <span class="src-var">$return </span>= <a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7480"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'return shifted value: '</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7481"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7482"></a>                       <span class="src-key">return </span><span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7483"></a>                <span class="src-comm">// nothing returned (ie, echoVoid)</span></li>
<li><a name="a7484"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7485"></a>                    <span class="src-key">return </span><span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7486"></a>                <span class="src-sym">}</span></li>
<li><a name="a7487"></a>            <span class="src-sym">}</span></li>
<li><a name="a7488"></a>        <span class="src-sym">}</span></li>
<li><a name="a7489"></a>    <span class="src-sym">}</span></li>
<li><a name="a7490"></a>&nbsp;</li>
<li><a name="a7491"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7492"></a><span class="src-doc">    * check WSDL passed as an instance or pulled from an endpoint</span></li>
<li><a name="a7493"></a><span class="src-doc">    *</span></li>
<li><a name="a7494"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7495"></a><span class="src-doc">    */</span></li>
<li><a name="a7496"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodcheckWSDL">checkWSDL</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7497"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7498"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7499"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'checkWSDL'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7500"></a>        <span class="src-comm">// catch errors</span></li>
<li><a name="a7501"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$errstr </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7502"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7503"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7504"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got wsdl error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7505"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'wsdl error: '</span>.<span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7506"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getOperations</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$portName">portName</a><span class="src-sym">, </span><span class="src-str">'soap'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7507"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7508"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7509"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a> = <span class="src-str">'soap'</span><span class="src-sym">;</span></li>
<li><a name="a7510"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got '</span>.<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a><span class="src-sym">)</span>.<span class="src-str">' operations from wsdl '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile</span>.<span class="src-str">' for binding type '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7511"></a>        <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getOperations</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$portName">portName</a><span class="src-sym">, </span><span class="src-str">'soap12'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7512"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7513"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7514"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a> = <span class="src-str">'soap12'</span><span class="src-sym">;</span></li>
<li><a name="a7515"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got '</span>.<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a><span class="src-sym">)</span>.<span class="src-str">' operations from wsdl '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile</span>.<span class="src-str">' for binding type '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7516"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'**************** WARNING: SOAP 1.2 BINDING *****************'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7517"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7518"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7519"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7520"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'getOperations returned false'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7521"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no operations defined in the WSDL document!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7522"></a>        <span class="src-sym">}</span></li>
<li><a name="a7523"></a>    <span class="src-sym">}</span></li>
<li><a name="a7524"></a>&nbsp;</li>
<li><a name="a7525"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7526"></a><span class="src-doc">     * instantiate wsdl object and parse wsdl file</span></li>
<li><a name="a7527"></a><span class="src-doc">     *</span></li>
<li><a name="a7528"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a7529"></a><span class="src-doc">     */</span></li>
<li><a name="a7530"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodloadWSDL">loadWSDL</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7531"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'instantiating wsdl class with doc: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7532"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/wsdl.html">wsdl</a></span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyusername">proxyusername</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxypassword">proxypassword</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$timeout">timeout</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response_timeout">response_timeout</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$curl_options">curl_options</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$use_curl">use_curl</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7533"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">setCredentials</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$username">username</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$password">password</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$authtype">authtype</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$certRequest">certRequest</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7534"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">-&gt;</span><span class="src-id">fetchWSDL</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7535"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodcheckWSDL">checkWSDL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7536"></a>    <span class="src-sym">}</span></li>
<li><a name="a7537"></a>&nbsp;</li>
<li><a name="a7538"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7539"></a><span class="src-doc">    * get available data pertaining to an operation</span></li>
<li><a name="a7540"></a><span class="src-doc">    *</span></li>
<li><a name="a7541"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$operation </span><span class="src-doc">operation name</span></li>
<li><a name="a7542"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">array of data pertaining to the operation</span></li>
<li><a name="a7543"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7544"></a><span class="src-doc">    */</span></li>
<li><a name="a7545"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetOperationData">getOperationData</a><span class="src-sym">(</span><span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7546"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> == <span class="src-str">'wsdl' </span>&amp;&amp; <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7547"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodloadWSDL">loadWSDL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7548"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">))</span></li>
<li><a name="a7549"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7550"></a>        <span class="src-sym">}</span></li>
<li><a name="a7551"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7552"></a>            <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a><span class="src-sym">[</span><span class="src-var">$operation</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7553"></a>        <span class="src-sym">}</span></li>
<li><a name="a7554"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">No data for operation: <span class="src-var">$operation</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7555"></a>    <span class="src-sym">}</span></li>
<li><a name="a7556"></a>&nbsp;</li>
<li><a name="a7557"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7558"></a><span class="src-doc">    * send the SOAP message</span></li>
<li><a name="a7559"></a><span class="src-doc">    *</span></li>
<li><a name="a7560"></a><span class="src-doc">    * Note: if the operation has multiple return values</span></li>
<li><a name="a7561"></a><span class="src-doc">    * the return value of this method will be an array</span></li>
<li><a name="a7562"></a><span class="src-doc">    * of those values.</span></li>
<li><a name="a7563"></a><span class="src-doc">    *</span></li>
<li><a name="a7564"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$msg </span><span class="src-doc">a SOAPx4 soapmsg object</span></li>
<li><a name="a7565"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapaction </span><span class="src-doc">SOAPAction value</span></li>
<li><a name="a7566"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$timeout </span><span class="src-doc">set connection timeout in seconds</span></li>
<li><a name="a7567"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">integer </span><span class="src-doc-var">$response_timeout </span><span class="src-doc">set response timeout in seconds</span></li>
<li><a name="a7568"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">native PHP types.</span></li>
<li><a name="a7569"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7570"></a><span class="src-doc">    */</span></li>
<li><a name="a7571"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsend">send</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">, </span><span class="src-var">$soapaction </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$timeout</span>=<span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$response_timeout</span>=<span class="src-num">30</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7572"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodcheckCookies">checkCookies</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7573"></a>        <span class="src-comm">// detect transport</span></li>
<li><a name="a7574"></a>        <span class="src-key">switch</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7575"></a>            <span class="src-comm">// http(s)</span></li>
<li><a name="a7576"></a>            <span class="src-key">case </span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^http/'</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">)</span>:</li>
<li><a name="a7577"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'transporting via HTTP'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7578"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a> == <span class="src-id">true </span>&amp;&amp; <a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7579"></a>                    <span class="src-var">$http </span>=<span class="src-sym">&amp; </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">;</span></li>
<li><a name="a7580"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7581"></a>                    <span class="src-var">$http </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/soap_transport_http.html">soap_transport_http</a></span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$curl_options">curl_options</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$use_curl">use_curl</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7582"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7583"></a>                        <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">usePersistentConnection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7584"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7585"></a>                <span class="src-sym">}</span></li>
<li><a name="a7586"></a>                <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">setContentType</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodgetHTTPContentType">getHTTPContentType</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodgetHTTPContentTypeCharset">getHTTPContentTypeCharset</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7587"></a>                <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">setSOAPAction</span><span class="src-sym">(</span><span class="src-var">$soapaction</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7588"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7589"></a>                    <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">setProxy</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyusername">proxyusername</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxypassword">proxypassword</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7590"></a>                <span class="src-sym">}</span></li>
<li><a name="a7591"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$authtype">authtype</a> != <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7592"></a>                    <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">setCredentials</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$username">username</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$password">password</a><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$authtype">authtype</a><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$certRequest">certRequest</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7593"></a>                <span class="src-sym">}</span></li>
<li><a name="a7594"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$http_encoding">http_encoding</a> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7595"></a>                    <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">setEncoding</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$http_encoding">http_encoding</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7596"></a>                <span class="src-sym">}</span></li>
<li><a name="a7597"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'sending message, length='</span>.<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7598"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^http:/'</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7599"></a>                <span class="src-comm">//if(strpos($this-&gt;endpoint,'http:')){</span></li>
<li><a name="a7600"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseData">responseData</a> = <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">send</span><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">,</span><span class="src-var">$timeout</span><span class="src-sym">,</span><span class="src-var">$response_timeout</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7601"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^https/'</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7602"></a>                <span class="src-comm">//} elseif(strpos($this-&gt;endpoint,'https:')){</span></li>
<li><a name="a7603"></a>                    <span class="src-comm">//if(phpversion() == '4.3.0-dev'){</span></li>
<li><a name="a7604"></a>                        <span class="src-comm">//$response = $http-&gt;send($msg,$timeout,$response_timeout);</span></li>
<li><a name="a7605"></a>                           <span class="src-comm">//$this-&gt;request = $http-&gt;outgoing_payload;</span></li>
<li><a name="a7606"></a>                        <span class="src-comm">//$this-&gt;response = $http-&gt;incoming_payload;</span></li>
<li><a name="a7607"></a>                    <span class="src-comm">//} else</span></li>
<li><a name="a7608"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseData">responseData</a> = <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">sendHTTPS</span><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">,</span><span class="src-var">$timeout</span><span class="src-sym">,</span><span class="src-var">$response_timeout</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7609"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7610"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no http/s in endpoint url'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7611"></a>                <span class="src-sym">}</span></li>
<li><a name="a7612"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$request">request</a> = <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">outgoing_payload</span><span class="src-sym">;</span></li>
<li><a name="a7613"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response">response</a> = <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">incoming_payload</span><span class="src-sym">;</span></li>
<li><a name="a7614"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7615"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodUpdateCookies">UpdateCookies</a><span class="src-sym">(</span><span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">incoming_cookies</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7616"></a>&nbsp;</li>
<li><a name="a7617"></a>                <span class="src-comm">// save transport object if using persistent connections</span></li>
<li><a name="a7618"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7619"></a>                    <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">clearDebug</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7620"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7621"></a>                        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a> = <span class="src-var">$http</span><span class="src-sym">;</span></li>
<li><a name="a7622"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7623"></a>                <span class="src-sym">}</span></li>
<li><a name="a7624"></a>                </li>
<li><a name="a7625"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$err </span>= <span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7626"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'HTTP Error: '</span>.<span class="src-var">$err</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7627"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7628"></a>                <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7629"></a>                    <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7630"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7631"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'got response, length='</span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseData">responseData</a><span class="src-sym">)</span>.<span class="src-str">' type='</span>.<span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">incoming_headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7632"></a>                    <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodparseResponse">parseResponse</a><span class="src-sym">(</span><span class="src-var">$http</span><span class="src-sym">-&gt;</span><span class="src-id">incoming_headers</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseData">responseData</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7633"></a>                <span class="src-sym">}</span></li>
<li><a name="a7634"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a7635"></a>            <span class="src-key">default</span>:</li>
<li><a name="a7636"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'no transport found, or selected transport is not yet supported!'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7637"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7638"></a>            <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a7639"></a>        <span class="src-sym">}</span></li>
<li><a name="a7640"></a>    <span class="src-sym">}</span></li>
<li><a name="a7641"></a>&nbsp;</li>
<li><a name="a7642"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7643"></a><span class="src-doc">    * processes SOAP message returned from server</span></li>
<li><a name="a7644"></a><span class="src-doc">    *</span></li>
<li><a name="a7645"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc">   </span><span class="src-doc-var">$headers </span><span class="src-doc">   The HTTP headers</span></li>
<li><a name="a7646"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc">   </span><span class="src-doc-var">$data </span><span class="src-doc">       unprocessed response data from server</span></li>
<li><a name="a7647"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc">   value of the message, decoded into a PHP type</span></li>
<li><a name="a7648"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7649"></a><span class="src-doc">    */</span></li>
<li><a name="a7650"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodparseResponse">parseResponse</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7651"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Entering parseResponse() for data of length ' </span>. <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">) </span>. <span class="src-str">' headers:'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7652"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7653"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7654"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Response not of type text/xml (no content-type header)'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7655"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7656"></a>        <span class="src-sym">}</span></li>
<li><a name="a7657"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'text/xml'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7658"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-str">'Response not of type text/xml: ' </span>. <span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7659"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7660"></a>        <span class="src-sym">}</span></li>
<li><a name="a7661"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">'content-type'</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7662"></a>            <span class="src-var">$enc </span>= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&quot;'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-str">&quot;content-type&quot;</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7663"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Got response encoding: ' </span>. <span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7664"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^(ISO-8859-1|US-ASCII|UTF-8)$/i'</span><span class="src-sym">,</span><span class="src-var">$enc</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7665"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$xml_encoding">xml_encoding</a> = <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$enc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7666"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7667"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'US-ASCII'</span><span class="src-sym">;</span></li>
<li><a name="a7668"></a>            <span class="src-sym">}</span></li>
<li><a name="a7669"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7670"></a>            <span class="src-comm">// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1</span></li>
<li><a name="a7671"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$xml_encoding">xml_encoding</a> = <span class="src-str">'ISO-8859-1'</span><span class="src-sym">;</span></li>
<li><a name="a7672"></a>        <span class="src-sym">}</span></li>
<li><a name="a7673"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Use encoding: ' </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$xml_encoding">xml_encoding</a> . <span class="src-str">' when creating nusoap_parser'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7674"></a>        <span class="src-var">$parser </span>= <span class="src-key">new </span><span class="src-id"><a href="../nusoap/nusoap_parser.html">nusoap_parser</a></span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$xml_encoding">xml_encoding</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">operation</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$decode_utf8">decode_utf8</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7675"></a>        <span class="src-comm">// add parser debug data to our debug</span></li>
<li><a name="a7676"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getDebug</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7677"></a>        <span class="src-comm">// if parse errors</span></li>
<li><a name="a7678"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$errstr </span>= <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getError</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a7679"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">( </span><span class="src-var">$errstr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7680"></a>            <span class="src-comm">// destroy the parser object</span></li>
<li><a name="a7681"></a>            unset<span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7682"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a7683"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7684"></a>            <span class="src-comm">// get SOAP headers</span></li>
<li><a name="a7685"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseHeaders">responseHeaders</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaders</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7686"></a>            <span class="src-comm">// get SOAP headers</span></li>
<li><a name="a7687"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseHeader">responseHeader</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">get_soapheader</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7688"></a>            <span class="src-comm">// get decoded message</span></li>
<li><a name="a7689"></a>            <span class="src-var">$return </span>= <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">get_soapbody</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7690"></a>            <span class="src-comm">// add document for doclit support</span></li>
<li><a name="a7691"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$document">document</a> = <span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">document</span><span class="src-sym">;</span></li>
<li><a name="a7692"></a>            <span class="src-comm">// destroy the parser object</span></li>
<li><a name="a7693"></a>            unset<span class="src-sym">(</span><span class="src-var">$parser</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7694"></a>            <span class="src-comm">// return decode message</span></li>
<li><a name="a7695"></a>            <span class="src-key">return </span><span class="src-var">$return</span><span class="src-sym">;</span></li>
<li><a name="a7696"></a>        <span class="src-sym">}</span></li>
<li><a name="a7697"></a>     <span class="src-sym">}</span></li>
<li><a name="a7698"></a>&nbsp;</li>
<li><a name="a7699"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7700"></a><span class="src-doc">    * sets user-specified cURL options</span></li>
<li><a name="a7701"></a><span class="src-doc">    *</span></li>
<li><a name="a7702"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$option </span><span class="src-doc">The cURL option (always integer?)</span></li>
<li><a name="a7703"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$value </span><span class="src-doc">The cURL option value</span></li>
<li><a name="a7704"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7705"></a><span class="src-doc">    */</span></li>
<li><a name="a7706"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetCurlOption">setCurlOption</a><span class="src-sym">(</span><span class="src-var">$option</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7707"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setCurlOption option=<span class="src-var">$option</span>, value=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7708"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7709"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$curl_options">curl_options</a><span class="src-sym">[</span><span class="src-var">$option</span><span class="src-sym">] </span>= <span class="src-var">$value</span><span class="src-sym">;</span></li>
<li><a name="a7710"></a>    <span class="src-sym">}</span></li>
<li><a name="a7711"></a>&nbsp;</li>
<li><a name="a7712"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7713"></a><span class="src-doc">    * sets the SOAP endpoint, which can override WSDL</span></li>
<li><a name="a7714"></a><span class="src-doc">    *</span></li>
<li><a name="a7715"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$endpoint </span><span class="src-doc">The endpoint URL to use, or empty string or false to prevent override</span></li>
<li><a name="a7716"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7717"></a><span class="src-doc">    */</span></li>
<li><a name="a7718"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetEndpoint">setEndpoint</a><span class="src-sym">(</span><span class="src-var">$endpoint</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7719"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setEndpoint(\&quot;<span class="src-var">$endpoint</span>\&quot;)</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7720"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$forceEndpoint">forceEndpoint</a> = <span class="src-var">$endpoint</span><span class="src-sym">;</span></li>
<li><a name="a7721"></a>    <span class="src-sym">}</span></li>
<li><a name="a7722"></a>&nbsp;</li>
<li><a name="a7723"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7724"></a><span class="src-doc">    * set the SOAP headers</span></li>
<li><a name="a7725"></a><span class="src-doc">    *</span></li>
<li><a name="a7726"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span><span class="src-doc-var">$headers </span><span class="src-doc">String of XML with SOAP header content, or array of soapval objects for SOAP headers</span></li>
<li><a name="a7727"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7728"></a><span class="src-doc">    */</span></li>
<li><a name="a7729"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetHeaders">setHeaders</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7730"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;setHeaders headers=&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7731"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$headers</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7732"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$requestHeaders">requestHeaders</a> = <span class="src-var">$headers</span><span class="src-sym">;</span></li>
<li><a name="a7733"></a>    <span class="src-sym">}</span></li>
<li><a name="a7734"></a>&nbsp;</li>
<li><a name="a7735"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7736"></a><span class="src-doc">    * get the SOAP response headers (namespace resolution incomplete)</span></li>
<li><a name="a7737"></a><span class="src-doc">    *</span></li>
<li><a name="a7738"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">string </span></li>
<li><a name="a7739"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7740"></a><span class="src-doc">    */</span></li>
<li><a name="a7741"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetHeaders">getHeaders</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7742"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseHeaders">responseHeaders</a><span class="src-sym">;</span></li>
<li><a name="a7743"></a>    <span class="src-sym">}</span></li>
<li><a name="a7744"></a>&nbsp;</li>
<li><a name="a7745"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7746"></a><span class="src-doc">    * get the SOAP response Header (parsed)</span></li>
<li><a name="a7747"></a><span class="src-doc">    *</span></li>
<li><a name="a7748"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">mixed </span></li>
<li><a name="a7749"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7750"></a><span class="src-doc">    */</span></li>
<li><a name="a7751"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetHeader">getHeader</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7752"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$responseHeader">responseHeader</a><span class="src-sym">;</span></li>
<li><a name="a7753"></a>    <span class="src-sym">}</span></li>
<li><a name="a7754"></a>&nbsp;</li>
<li><a name="a7755"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7756"></a><span class="src-doc">    * set proxy info here</span></li>
<li><a name="a7757"></a><span class="src-doc">    *</span></li>
<li><a name="a7758"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyhost </span></li>
<li><a name="a7759"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyport </span></li>
<li><a name="a7760"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxyusername </span></li>
<li><a name="a7761"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$proxypassword </span></li>
<li><a name="a7762"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7763"></a><span class="src-doc">    */</span></li>
<li><a name="a7764"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetHTTPProxy">setHTTPProxy</a><span class="src-sym">(</span><span class="src-var">$proxyhost</span><span class="src-sym">, </span><span class="src-var">$proxyport</span><span class="src-sym">, </span><span class="src-var">$proxyusername </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$proxypassword </span>= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7765"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a> = <span class="src-var">$proxyhost</span><span class="src-sym">;</span></li>
<li><a name="a7766"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a> = <span class="src-var">$proxyport</span><span class="src-sym">;</span></li>
<li><a name="a7767"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyusername">proxyusername</a> = <span class="src-var">$proxyusername</span><span class="src-sym">;</span></li>
<li><a name="a7768"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxypassword">proxypassword</a> = <span class="src-var">$proxypassword</span><span class="src-sym">;</span></li>
<li><a name="a7769"></a>    <span class="src-sym">}</span></li>
<li><a name="a7770"></a>&nbsp;</li>
<li><a name="a7771"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7772"></a><span class="src-doc">    * if authenticating, set user credentials here</span></li>
<li><a name="a7773"></a><span class="src-doc">    *</span></li>
<li><a name="a7774"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$username </span></li>
<li><a name="a7775"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$password </span></li>
<li><a name="a7776"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$authtype </span><span class="src-doc">(basic|digest|certificate|ntlm)</span></li>
<li><a name="a7777"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$certRequest </span><span class="src-doc">(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)</span></li>
<li><a name="a7778"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7779"></a><span class="src-doc">    */</span></li>
<li><a name="a7780"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetCredentials">setCredentials</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">, </span><span class="src-var">$password</span><span class="src-sym">, </span><span class="src-var">$authtype </span>= <span class="src-str">'basic'</span><span class="src-sym">, </span><span class="src-var">$certRequest </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7781"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setCredentials username=<span class="src-var">$username</span> authtype=<span class="src-var">$authtype</span> certRequest=</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7782"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$certRequest</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7783"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$username">username</a> = <span class="src-var">$username</span><span class="src-sym">;</span></li>
<li><a name="a7784"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$password">password</a> = <span class="src-var">$password</span><span class="src-sym">;</span></li>
<li><a name="a7785"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$authtype">authtype</a> = <span class="src-var">$authtype</span><span class="src-sym">;</span></li>
<li><a name="a7786"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$certRequest">certRequest</a> = <span class="src-var">$certRequest</span><span class="src-sym">;</span></li>
<li><a name="a7787"></a>    <span class="src-sym">}</span></li>
<li><a name="a7788"></a>    </li>
<li><a name="a7789"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7790"></a><span class="src-doc">    * use HTTP encoding</span></li>
<li><a name="a7791"></a><span class="src-doc">    *</span></li>
<li><a name="a7792"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$enc </span><span class="src-doc">HTTP encoding</span></li>
<li><a name="a7793"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7794"></a><span class="src-doc">    */</span></li>
<li><a name="a7795"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetHTTPEncoding">setHTTPEncoding</a><span class="src-sym">(</span><span class="src-var">$enc</span>=<span class="src-str">'gzip, deflate'</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7796"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setHTTPEncoding(\&quot;<span class="src-var">$enc</span>\&quot;)</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7797"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$http_encoding">http_encoding</a> = <span class="src-var">$enc</span><span class="src-sym">;</span></li>
<li><a name="a7798"></a>    <span class="src-sym">}</span></li>
<li><a name="a7799"></a>    </li>
<li><a name="a7800"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7801"></a><span class="src-doc">    * Set whether to try to use cURL connections if possible</span></li>
<li><a name="a7802"></a><span class="src-doc">    *</span></li>
<li><a name="a7803"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$use </span><span class="src-doc">Whether to try to use cURL</span></li>
<li><a name="a7804"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7805"></a><span class="src-doc">    */</span></li>
<li><a name="a7806"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetUseCURL">setUseCURL</a><span class="src-sym">(</span><span class="src-var">$use</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7807"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">setUseCURL(<span class="src-var">$use</span>)</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7808"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$use_curl">use_curl</a> = <span class="src-var">$use</span><span class="src-sym">;</span></li>
<li><a name="a7809"></a>    <span class="src-sym">}</span></li>
<li><a name="a7810"></a>&nbsp;</li>
<li><a name="a7811"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7812"></a><span class="src-doc">    * use HTTP persistent connections if possible</span></li>
<li><a name="a7813"></a><span class="src-doc">    *</span></li>
<li><a name="a7814"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7815"></a><span class="src-doc">    */</span></li>
<li><a name="a7816"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methoduseHTTPPersistentConnection">useHTTPPersistentConnection</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a7817"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;useHTTPPersistentConnection&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7818"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a> = <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a7819"></a>    <span class="src-sym">}</span></li>
<li><a name="a7820"></a>    </li>
<li><a name="a7821"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7822"></a><span class="src-doc">    * gets the default RPC parameter setting.</span></li>
<li><a name="a7823"></a><span class="src-doc">    * If true, default is that call params are like RPC even for document style.</span></li>
<li><a name="a7824"></a><span class="src-doc">    * Each call() can override this value.</span></li>
<li><a name="a7825"></a><span class="src-doc">    *</span></li>
<li><a name="a7826"></a><span class="src-doc">    * This is no longer used.</span></li>
<li><a name="a7827"></a><span class="src-doc">    *</span></li>
<li><a name="a7828"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">boolean </span></li>
<li><a name="a7829"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a7830"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a7831"></a><span class="src-doc">    */</span></li>
<li><a name="a7832"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetDefaultRpcParams">getDefaultRpcParams</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7833"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$defaultRpcParams">defaultRpcParams</a><span class="src-sym">;</span></li>
<li><a name="a7834"></a>    <span class="src-sym">}</span></li>
<li><a name="a7835"></a>&nbsp;</li>
<li><a name="a7836"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7837"></a><span class="src-doc">    * sets the default RPC parameter setting.</span></li>
<li><a name="a7838"></a><span class="src-doc">    * If true, default is that call params are like RPC even for document style</span></li>
<li><a name="a7839"></a><span class="src-doc">    * Each call() can override this value.</span></li>
<li><a name="a7840"></a><span class="src-doc">    *</span></li>
<li><a name="a7841"></a><span class="src-doc">    * This is no longer used.</span></li>
<li><a name="a7842"></a><span class="src-doc">    *</span></li>
<li><a name="a7843"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc-var">$rpcParams </span></li>
<li><a name="a7844"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span></li>
<li><a name="a7845"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@deprecated</span></li>
<li><a name="a7846"></a><span class="src-doc">    */</span></li>
<li><a name="a7847"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetDefaultRpcParams">setDefaultRpcParams</a><span class="src-sym">(</span><span class="src-var">$rpcParams</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7848"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$defaultRpcParams">defaultRpcParams</a> = <span class="src-var">$rpcParams</span><span class="src-sym">;</span></li>
<li><a name="a7849"></a>    <span class="src-sym">}</span></li>
<li><a name="a7850"></a>    </li>
<li><a name="a7851"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7852"></a><span class="src-doc">    * dynamically creates an instance of a proxy class,</span></li>
<li><a name="a7853"></a><span class="src-doc">    * allowing user to directly call methods from wsdl</span></li>
<li><a name="a7854"></a><span class="src-doc">    *</span></li>
<li><a name="a7855"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">object </span><span class="src-doc-type">soap_proxy </span><span class="src-doc">object</span></li>
<li><a name="a7856"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7857"></a><span class="src-doc">    */</span></li>
<li><a name="a7858"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetProxy">getProxy</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7859"></a>        <span class="src-var">$r </span>= <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7860"></a>        <span class="src-var">$evalStr </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#method_getProxyClassCode">_getProxyClassCode</a><span class="src-sym">(</span><span class="src-var">$r</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7861"></a>        <span class="src-comm">//$this-&gt;debug(&quot;proxy class: $evalStr&quot;);</span></li>
<li><a name="a7862"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7863"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;Error from _getProxyClassCode, so return NULL&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7864"></a>            <span class="src-key">return </span><span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a7865"></a>        <span class="src-sym">}</span></li>
<li><a name="a7866"></a>        <span class="src-comm">// eval the class</span></li>
<li><a name="a7867"></a>        eval<span class="src-sym">(</span><span class="src-var">$evalStr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7868"></a>        <span class="src-comm">// instantiate proxy object</span></li>
<li><a name="a7869"></a>        eval<span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">\$proxy = new nusoap_proxy_<span class="src-var">$r</span>('');</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7870"></a>        <span class="src-comm">// transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice</span></li>
<li><a name="a7871"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">endpointType </span>= <span class="src-str">'wsdl'</span><span class="src-sym">;</span></li>
<li><a name="a7872"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">wsdlFile </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdlFile</span><span class="src-sym">;</span></li>
<li><a name="a7873"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">wsdl </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">;</span></li>
<li><a name="a7874"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">operations </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a><span class="src-sym">;</span></li>
<li><a name="a7875"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">defaultRpcParams </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$defaultRpcParams">defaultRpcParams</a><span class="src-sym">;</span></li>
<li><a name="a7876"></a>        <span class="src-comm">// transfer other state</span></li>
<li><a name="a7877"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">soap_defencoding </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a><span class="src-sym">;</span></li>
<li><a name="a7878"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">username </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$username">username</a><span class="src-sym">;</span></li>
<li><a name="a7879"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">password </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$password">password</a><span class="src-sym">;</span></li>
<li><a name="a7880"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">authtype </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$authtype">authtype</a><span class="src-sym">;</span></li>
<li><a name="a7881"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">certRequest </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$certRequest">certRequest</a><span class="src-sym">;</span></li>
<li><a name="a7882"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">requestHeaders </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$requestHeaders">requestHeaders</a><span class="src-sym">;</span></li>
<li><a name="a7883"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">endpoint </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpoint">endpoint</a><span class="src-sym">;</span></li>
<li><a name="a7884"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">forceEndpoint </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$forceEndpoint">forceEndpoint</a><span class="src-sym">;</span></li>
<li><a name="a7885"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">proxyhost </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyhost">proxyhost</a><span class="src-sym">;</span></li>
<li><a name="a7886"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">proxyport </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyport">proxyport</a><span class="src-sym">;</span></li>
<li><a name="a7887"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">proxyusername </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxyusername">proxyusername</a><span class="src-sym">;</span></li>
<li><a name="a7888"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">proxypassword </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$proxypassword">proxypassword</a><span class="src-sym">;</span></li>
<li><a name="a7889"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">http_encoding </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$http_encoding">http_encoding</a><span class="src-sym">;</span></li>
<li><a name="a7890"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">timeout </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$timeout">timeout</a><span class="src-sym">;</span></li>
<li><a name="a7891"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">response_timeout </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$response_timeout">response_timeout</a><span class="src-sym">;</span></li>
<li><a name="a7892"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">persistentConnection </span>= <span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$persistentConnection">persistentConnection</a><span class="src-sym">;</span></li>
<li><a name="a7893"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">decode_utf8 </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$decode_utf8">decode_utf8</a><span class="src-sym">;</span></li>
<li><a name="a7894"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">curl_options </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$curl_options">curl_options</a><span class="src-sym">;</span></li>
<li><a name="a7895"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">bindingType </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$bindingType">bindingType</a><span class="src-sym">;</span></li>
<li><a name="a7896"></a>        <span class="src-var">$proxy</span><span class="src-sym">-&gt;</span><span class="src-id">use_curl </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$use_curl">use_curl</a><span class="src-sym">;</span></li>
<li><a name="a7897"></a>        <span class="src-key">return </span><span class="src-var">$proxy</span><span class="src-sym">;</span></li>
<li><a name="a7898"></a>    <span class="src-sym">}</span></li>
<li><a name="a7899"></a>&nbsp;</li>
<li><a name="a7900"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7901"></a><span class="src-doc">    * dynamically creates proxy class code</span></li>
<li><a name="a7902"></a><span class="src-doc">    *</span></li>
<li><a name="a7903"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">string </span><span class="src-doc">PHP/NuSOAP code for the proxy class</span></li>
<li><a name="a7904"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a7905"></a><span class="src-doc">    */</span></li>
<li><a name="a7906"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#method_getProxyClassCode">_getProxyClassCode</a><span class="src-sym">(</span><span class="src-var">$r</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7907"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">in getProxy endpointType=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a><span class="src-str">"</span></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7908"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodappendDebug">appendDebug</a><span class="src-sym">(</span><span class="src-str">&quot;wsdl=&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodvarDump">varDump</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a7909"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> != <span class="src-str">'wsdl'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7910"></a>            <span class="src-var">$evalStr </span>= <span class="src-str">'A proxy can only be created for a WSDL client'</span><span class="src-sym">;</span></li>
<li><a name="a7911"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodsetError">setError</a><span class="src-sym">(</span><span class="src-var">$evalStr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7912"></a>            <span class="src-var">$evalStr </span>= <span class="src-str">&quot;</span><span class="src-str">echo \&quot;<span class="src-var">$evalStr</span>\&quot;;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7913"></a>            <span class="src-key">return </span><span class="src-var">$evalStr</span><span class="src-sym">;</span></li>
<li><a name="a7914"></a>        <span class="src-sym">}</span></li>
<li><a name="a7915"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$endpointType">endpointType</a> == <span class="src-str">'wsdl' </span>&amp;&amp; <a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">wsdl</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7916"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#methodloadWSDL">loadWSDL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7917"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a7918"></a>                <span class="src-key">return </span><span class="src-str">&quot;echo \&quot;&quot; </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methodgetError">getError</a><span class="src-sym">(</span><span class="src-sym">) </span>. <span class="src-str">&quot;\&quot;;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7919"></a>            <span class="src-sym">}</span></li>
<li><a name="a7920"></a>        <span class="src-sym">}</span></li>
<li><a name="a7921"></a>        <span class="src-var">$evalStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7922"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$operations">operations</a> <span class="src-key">as </span><span class="src-var">$operation </span>=&gt; <span class="src-var">$opData</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7923"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$operation </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7924"></a>                <span class="src-comm">// create param string and param comment string</span></li>
<li><a name="a7925"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7926"></a>                    <span class="src-var">$paramStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7927"></a>                    <span class="src-var">$paramArrayStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7928"></a>                    <span class="src-var">$paramCommentStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7929"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'input'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'parts'</span><span class="src-sym">] </span><span class="src-key">as </span><span class="src-var">$name </span>=&gt; <span class="src-var">$type</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7930"></a>                        <span class="src-var">$paramStr </span>.= <span class="src-str">&quot;</span><span class="src-str">\$<span class="src-var">$name</span>, </span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7931"></a>                        <span class="src-var">$paramArrayStr </span>.= <span class="src-str">&quot;</span><span class="src-str">'<span class="src-var">$name</span>' =&gt; \$<span class="src-var">$name</span>, </span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7932"></a>                        <span class="src-var">$paramCommentStr </span>.= <span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$type</span> \$<span class="src-var">$name</span>, </span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a7933"></a>                    <span class="src-sym">}</span></li>
<li><a name="a7934"></a>                    <span class="src-var">$paramStr </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$paramStr</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$paramStr</span><span class="src-sym">)</span>-<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7935"></a>                    <span class="src-var">$paramArrayStr </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$paramArrayStr</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$paramArrayStr</span><span class="src-sym">)</span>-<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7936"></a>                    <span class="src-var">$paramCommentStr </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$paramCommentStr</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$paramCommentStr</span><span class="src-sym">)</span>-<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7937"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a7938"></a>                    <span class="src-var">$paramStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7939"></a>                    <span class="src-var">$paramArrayStr </span>= <span class="src-str">''</span><span class="src-sym">;</span></li>
<li><a name="a7940"></a>                    <span class="src-var">$paramCommentStr </span>= <span class="src-str">'void'</span><span class="src-sym">;</span></li>
<li><a name="a7941"></a>                <span class="src-sym">}</span></li>
<li><a name="a7942"></a>                <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">] </span>= <span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-str">'http://testuri.com' </span>: <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a7943"></a>                <span class="src-var">$evalStr </span>.= <span class="src-str">&quot;</span><span class="src-str">// <span class="src-var">$paramCommentStr</span></span></li>
<li><a name="a7944"></a></span><span class="src-str">    function </span><span class="src-str">&quot; </span>. <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'.'</span><span class="src-sym">, </span><span class="src-str">'__'</span><span class="src-sym">, </span><span class="src-var">$operation</span><span class="src-sym">) </span>. <span class="src-str">&quot;</span><span class="src-str">(<span class="src-var">$paramStr</span>) {</span></li>
<li><a name="a7945"></a></span><span class="src-str">        \$params = array(<span class="src-var">$paramArrayStr</span>);</span></li>
<li><a name="a7946"></a></span><span class="src-str">        return \$this-&gt;call('<span class="src-var">$operation</span>', \$params, '</span><span class="src-str">&quot;</span>.<span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'namespace'</span><span class="src-sym">]</span>.<span class="src-str">&quot;', '&quot;</span>.<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$opData</span><span class="src-sym">[</span><span class="src-str">'soapAction'</span><span class="src-sym">] </span>: <span class="src-str">''</span><span class="src-sym">)</span>.<span class="src-str">&quot;');</span></li>
<li><a name="a7947"></a><span class="src-str">    }</span></li>
<li><a name="a7948"></a><span class="src-str">    &quot;</span><span class="src-sym">;</span></li>
<li><a name="a7949"></a>                unset<span class="src-sym">(</span><span class="src-var">$paramStr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7950"></a>                unset<span class="src-sym">(</span><span class="src-var">$paramCommentStr</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7951"></a>            <span class="src-sym">}</span></li>
<li><a name="a7952"></a>        <span class="src-sym">}</span></li>
<li><a name="a7953"></a>        <span class="src-var">$evalStr </span>= <span class="src-str">'class nusoap_proxy_'</span>.<span class="src-var">$r</span>.<span class="src-str">' extends nusoap_client {</span></li>
<li><a name="a7954"></a><span class="src-str">    '</span>.<span class="src-var">$evalStr</span>.<span class="src-str">'</span></li>
<li><a name="a7955"></a><span class="src-str">}'</span><span class="src-sym">;</span></li>
<li><a name="a7956"></a>        <span class="src-key">return </span><span class="src-var">$evalStr</span><span class="src-sym">;</span></li>
<li><a name="a7957"></a>    <span class="src-sym">}</span></li>
<li><a name="a7958"></a>&nbsp;</li>
<li><a name="a7959"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7960"></a><span class="src-doc">    * dynamically creates proxy class code</span></li>
<li><a name="a7961"></a><span class="src-doc">    *</span></li>
<li><a name="a7962"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">string </span><span class="src-doc">PHP/NuSOAP code for the proxy class</span></li>
<li><a name="a7963"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a7964"></a><span class="src-doc">    */</span></li>
<li><a name="a7965"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetProxyClassCode">getProxyClassCode</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7966"></a>        <span class="src-var">$r </span>= <a href="http://www.php.net/rand">rand</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7967"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#method_getProxyClassCode">_getProxyClassCode</a><span class="src-sym">(</span><span class="src-var">$r</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a7968"></a>    <span class="src-sym">}</span></li>
<li><a name="a7969"></a>&nbsp;</li>
<li><a name="a7970"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7971"></a><span class="src-doc">    * gets the HTTP body for the current request.</span></li>
<li><a name="a7972"></a><span class="src-doc">    *</span></li>
<li><a name="a7973"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$soapmsg </span><span class="src-doc">The SOAP payload</span></li>
<li><a name="a7974"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">The HTTP body, which includes the SOAP payload</span></li>
<li><a name="a7975"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a7976"></a><span class="src-doc">    */</span></li>
<li><a name="a7977"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetHTTPBody">getHTTPBody</a><span class="src-sym">(</span><span class="src-var">$soapmsg</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7978"></a>        <span class="src-key">return </span><span class="src-var">$soapmsg</span><span class="src-sym">;</span></li>
<li><a name="a7979"></a>    <span class="src-sym">}</span></li>
<li><a name="a7980"></a>    </li>
<li><a name="a7981"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7982"></a><span class="src-doc">    * gets the HTTP content type for the current request.</span></li>
<li><a name="a7983"></a><span class="src-doc">    *</span></li>
<li><a name="a7984"></a><span class="src-doc">    * Note: getHTTPBody must be called before this.</span></li>
<li><a name="a7985"></a><span class="src-doc">    *</span></li>
<li><a name="a7986"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">the HTTP content type for the current request.</span></li>
<li><a name="a7987"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a7988"></a><span class="src-doc">    */</span></li>
<li><a name="a7989"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetHTTPContentType">getHTTPContentType</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a7990"></a>        <span class="src-key">return </span><span class="src-str">'text/xml'</span><span class="src-sym">;</span></li>
<li><a name="a7991"></a>    <span class="src-sym">}</span></li>
<li><a name="a7992"></a>    </li>
<li><a name="a7993"></a>    <span class="src-doc">/**</span></li>
<li><a name="a7994"></a><span class="src-doc">    * gets the HTTP content type charset for the current request.</span></li>
<li><a name="a7995"></a><span class="src-doc">    * returns false for non-text content types.</span></li>
<li><a name="a7996"></a><span class="src-doc">    *</span></li>
<li><a name="a7997"></a><span class="src-doc">    * Note: getHTTPBody must be called before this.</span></li>
<li><a name="a7998"></a><span class="src-doc">    *</span></li>
<li><a name="a7999"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">the HTTP content type charset for the current request.</span></li>
<li><a name="a8000"></a><span class="src-doc">    * </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span></li>
<li><a name="a8001"></a><span class="src-doc">    */</span></li>
<li><a name="a8002"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetHTTPContentTypeCharset">getHTTPContentTypeCharset</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8003"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#var$soap_defencoding">soap_defencoding</a><span class="src-sym">;</span></li>
<li><a name="a8004"></a>    <span class="src-sym">}</span></li>
<li><a name="a8005"></a>&nbsp;</li>
<li><a name="a8006"></a>    <span class="src-comm">/*</span></li>
<li><a name="a8007"></a><span class="src-comm">    * whether or not parser should decode utf8 element content</span></li>
<li><a name="a8008"></a><span class="src-comm">    *</span></li>
<li><a name="a8009"></a><span class="src-comm">    * @return   always returns true</span></li>
<li><a name="a8010"></a><span class="src-comm">    * @access   public</span></li>
<li><a name="a8011"></a><span class="src-comm">    */</span></li>
<li><a name="a8012"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methoddecodeUTF8">decodeUTF8</a><span class="src-sym">(</span><span class="src-var">$bool</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a8013"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$decode_utf8">decode_utf8</a> = <span class="src-var">$bool</span><span class="src-sym">;</span></li>
<li><a name="a8014"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8015"></a>    <span class="src-sym">}</span></li>
<li><a name="a8016"></a>&nbsp;</li>
<li><a name="a8017"></a>    <span class="src-doc">/**</span></li>
<li><a name="a8018"></a><span class="src-doc">     * adds a new Cookie into $this-&gt;cookies array</span></li>
<li><a name="a8019"></a><span class="src-doc">     *</span></li>
<li><a name="a8020"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$name </span><span class="src-doc">Cookie Name</span></li>
<li><a name="a8021"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">string </span><span class="src-doc-var">$value </span><span class="src-doc">Cookie Value</span></li>
<li><a name="a8022"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">if cookie-set was successful returns true, else false</span></li>
<li><a name="a8023"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    public</span></li>
<li><a name="a8024"></a><span class="src-doc">     */</span></li>
<li><a name="a8025"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodsetCookie">setCookie</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8026"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8027"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a8028"></a>        <span class="src-sym">}</span></li>
<li><a name="a8029"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name' </span>=&gt; <span class="src-var">$name</span><span class="src-sym">, </span><span class="src-str">'value' </span>=&gt; <span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8030"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8031"></a>    <span class="src-sym">}</span></li>
<li><a name="a8032"></a>&nbsp;</li>
<li><a name="a8033"></a>    <span class="src-doc">/**</span></li>
<li><a name="a8034"></a><span class="src-doc">     * gets all Cookies</span></li>
<li><a name="a8035"></a><span class="src-doc">     *</span></li>
<li><a name="a8036"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">array </span><span class="src-doc">with all internal cookies</span></li>
<li><a name="a8037"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   public</span></li>
<li><a name="a8038"></a><span class="src-doc">     */</span></li>
<li><a name="a8039"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodgetCookies">getCookies</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8040"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">;</span></li>
<li><a name="a8041"></a>    <span class="src-sym">}</span></li>
<li><a name="a8042"></a>&nbsp;</li>
<li><a name="a8043"></a>    <span class="src-doc">/**</span></li>
<li><a name="a8044"></a><span class="src-doc">     * checks all Cookies and delete those which are expired</span></li>
<li><a name="a8045"></a><span class="src-doc">     *</span></li>
<li><a name="a8046"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">  </span><span class="src-doc-type">boolean </span><span class="src-doc">always return true</span></li>
<li><a name="a8047"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">   private</span></li>
<li><a name="a8048"></a><span class="src-doc">     */</span></li>
<li><a name="a8049"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodcheckCookies">checkCookies</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8050"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8051"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8052"></a>        <span class="src-sym">}</span></li>
<li><a name="a8053"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'checkCookie: check ' </span>. <a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">) </span>. <span class="src-str">' cookies'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8054"></a>        <span class="src-var">$curr_cookies </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">;</span></li>
<li><a name="a8055"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8056"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$curr_cookies </span><span class="src-key">as </span><span class="src-var">$cookie</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8057"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8058"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Remove cookie that is not an array'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8059"></a>                <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8060"></a>            <span class="src-sym">}</span></li>
<li><a name="a8061"></a>            <span class="src-key">if </span><span class="src-sym">((</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">)) </span>&amp;&amp; <span class="src-sym">(</span><span class="src-sym">! </span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a8062"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'expires'</span><span class="src-sym">]</span><span class="src-sym">) </span>&gt; <a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8063"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$cookie</span><span class="src-sym">;</span></li>
<li><a name="a8064"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a8065"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Remove expired cookie ' </span>. <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8066"></a>                <span class="src-sym">}</span></li>
<li><a name="a8067"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a8068"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$cookie</span><span class="src-sym">;</span></li>
<li><a name="a8069"></a>            <span class="src-sym">}</span></li>
<li><a name="a8070"></a>        <span class="src-sym">}</span></li>
<li><a name="a8071"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'checkCookie: '</span>.<a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">)</span>.<span class="src-str">' cookies left in array'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8072"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8073"></a>    <span class="src-sym">}</span></li>
<li><a name="a8074"></a>&nbsp;</li>
<li><a name="a8075"></a>    <span class="src-doc">/**</span></li>
<li><a name="a8076"></a><span class="src-doc">     * updates the current cookies with a new set</span></li>
<li><a name="a8077"></a><span class="src-doc">     *</span></li>
<li><a name="a8078"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">   </span><span class="src-doc-type">array </span><span class="src-doc-var">$cookies </span><span class="src-doc">new cookies with which to update current ones</span></li>
<li><a name="a8079"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">   </span><span class="src-doc-type">boolean </span><span class="src-doc">always return true</span></li>
<li><a name="a8080"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@access</span><span class="src-doc">    private</span></li>
<li><a name="a8081"></a><span class="src-doc">     */</span></li>
<li><a name="a8082"></a>    <span class="src-key">function </span><a href="../nusoap/nusoap_client.html#methodUpdateCookies">UpdateCookies</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8083"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8084"></a>            <span class="src-comm">// no existing cookies: take whatever is new</span></li>
<li><a name="a8085"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8086"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Setting new cookie(s)'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8087"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a> = <span class="src-var">$cookies</span><span class="src-sym">;</span></li>
<li><a name="a8088"></a>            <span class="src-sym">}</span></li>
<li><a name="a8089"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8090"></a>        <span class="src-sym">}</span></li>
<li><a name="a8091"></a>        <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$cookies</span><span class="src-sym">) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8092"></a>            <span class="src-comm">// no new cookies: keep what we've got</span></li>
<li><a name="a8093"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8094"></a>        <span class="src-sym">}</span></li>
<li><a name="a8095"></a>        <span class="src-comm">// merge</span></li>
<li><a name="a8096"></a>        <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$cookies </span><span class="src-key">as </span><span class="src-var">$newCookie</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8097"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$newCookie</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8098"></a>                <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8099"></a>            <span class="src-sym">}</span></li>
<li><a name="a8100"></a>            <span class="src-key">if </span><span class="src-sym">((</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)) </span>|| <span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">))) </span><span class="src-sym">{</span></li>
<li><a name="a8101"></a>                <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8102"></a>            <span class="src-sym">}</span></li>
<li><a name="a8103"></a>            <span class="src-var">$newName </span>= <span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a8104"></a>&nbsp;</li>
<li><a name="a8105"></a>            <span class="src-var">$found </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a8106"></a>            <span class="src-key">for </span><span class="src-sym">(</span><span class="src-var">$i </span>= <span class="src-num">0</span><span class="src-sym">; </span><span class="src-var">$i </span>&lt; <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-var">$i</span>++<span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8107"></a>                <span class="src-var">$cookie </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a8108"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8109"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8110"></a>                <span class="src-sym">}</span></li>
<li><a name="a8111"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8112"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8113"></a>                <span class="src-sym">}</span></li>
<li><a name="a8114"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$newName </span>!= <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8115"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8116"></a>                <span class="src-sym">}</span></li>
<li><a name="a8117"></a>                <span class="src-var">$newDomain </span>= isset<span class="src-sym">(</span><span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">] </span>: <span class="src-str">'NODOMAIN'</span><span class="src-sym">;</span></li>
<li><a name="a8118"></a>                <span class="src-var">$domain </span>= isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'domain'</span><span class="src-sym">] </span>: <span class="src-str">'NODOMAIN'</span><span class="src-sym">;</span></li>
<li><a name="a8119"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$newDomain </span>!= <span class="src-var">$domain</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8120"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8121"></a>                <span class="src-sym">}</span></li>
<li><a name="a8122"></a>                <span class="src-var">$newPath </span>= isset<span class="src-sym">(</span><span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">] </span>: <span class="src-str">'NOPATH'</span><span class="src-sym">;</span></li>
<li><a name="a8123"></a>                <span class="src-var">$path </span>= isset<span class="src-sym">(</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-str">'path'</span><span class="src-sym">] </span>: <span class="src-str">'NOPATH'</span><span class="src-sym">;</span></li>
<li><a name="a8124"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$newPath </span>!= <span class="src-var">$path</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8125"></a>                    <span class="src-key">continue</span><span class="src-sym">;</span></li>
<li><a name="a8126"></a>                <span class="src-sym">}</span></li>
<li><a name="a8127"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">] </span>= <span class="src-var">$newCookie</span><span class="src-sym">;</span></li>
<li><a name="a8128"></a>                <span class="src-var">$found </span>= <span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8129"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Update cookie ' </span>. <span class="src-var">$newName </span>. <span class="src-str">'=' </span>. <span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8130"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a8131"></a>            <span class="src-sym">}</span></li>
<li><a name="a8132"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">! </span><span class="src-var">$found</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a8133"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_base.html#methoddebug">debug</a><span class="src-sym">(</span><span class="src-str">'Add cookie ' </span>. <span class="src-var">$newName </span>. <span class="src-str">'=' </span>. <span class="src-var">$newCookie</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a8134"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../nusoap/nusoap_client.html#var$cookies">cookies</a><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$newCookie</span><span class="src-sym">;</span></li>
<li><a name="a8135"></a>            <span class="src-sym">}</span></li>
<li><a name="a8136"></a>        <span class="src-sym">}</span></li>
<li><a name="a8137"></a>        <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a8138"></a>    <span class="src-sym">}</span></li>
<li><a name="a8139"></a><span class="src-sym">}</span></li>
<li><a name="a8140"></a>&nbsp;</li>
<li><a name="a8141"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/extension_loaded">extension_loaded</a><span class="src-sym">(</span><span class="src-str">'soap'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a8142"></a>    <span class="src-doc">/**</span></li>
<li><a name="a8143"></a><span class="src-doc">     *    For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded.</span></li>
<li><a name="a8144"></a><span class="src-doc">     */</span></li>
<li><a name="a8145"></a>    <span class="src-key">class </span><a href="../nusoap/soapclient.html">soapclient</a> <span class="src-key">extends </span><a href="../nusoap/nusoap_client.html#methodnusoap_client">nusoap_client</a> <span class="src-sym">{</span></li>
<li><a name="a8146"></a>    <span class="src-sym">}</span></li>
<li><a name="a8147"></a><span class="src-sym">}</span></li>
<li><a name="a8148"></a><span class="src-php">?&gt;</span></li>
</ol></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Mon, 26 Apr 2010 16:17:01 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</body>
</html>